Coverage details for edu.umn.gis.mapscript.imp.MapScript

LineHitsSource
1 // A Java MapScript module for MapServer.
2 // See <http://mapserver.gis.umn.edu> for information on MapServer.
3 //
4 // Copyright (C) 2003 Andrew Collins <andrewrcollins@yahoo.com>
5 //
6 // This library is free software; you can redistribute it
7 // and/or modify it under the terms of the GNU Lesser General
8 // Public License as published by the Free Software Foundation;
9 // either version 2.1 of the License, or (at your option) any
10 // later version.
11 //
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty
14 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15 // See the GNU Lesser General Public License for more details.
16 //
17 // You should have received a copy of the GNU Lesser General
18 // Public License along with this library; if not, write to
19 // the Free Software Foundation, Inc., 59 Temple Place,
20 // Suite 330, Boston, MA 02111-1307 USA
21 package edu.umn.gis.mapscript.imp;
22  
23 /**
24  * DOCUMENT ME!
25  *
26  * @author <a href="mailto:ADDRESS">NAME</a>
27  *
28  * @todo CLASS_DESCRIPTION
29  */
300public class MapScript
31 {
32   /**
33    * DOCUMENT ME!
34    *
35    * @todo FIELD_DESCRIPTION
36    */
370  public static final int MS_SHAPEFILE_POINT = MapScriptJNI.get_MS_SHAPEFILE_POINT();
38  
39   /**
40    * DOCUMENT ME!
41    *
42    * @todo FIELD_DESCRIPTION
43    */
440  public static final int MS_SHAPEFILE_ARC = MapScriptJNI.get_MS_SHAPEFILE_ARC();
45  
46   /**
47    * DOCUMENT ME!
48    *
49    * @todo FIELD_DESCRIPTION
50    */
510  public static final int MS_SHAPEFILE_POLYGON = MapScriptJNI.get_MS_SHAPEFILE_POLYGON();
52  
53   /**
54    * DOCUMENT ME!
55    *
56    * @todo FIELD_DESCRIPTION
57    */
580  public static final int MS_SHAPEFILE_MULTIPOINT = MapScriptJNI.get_MS_SHAPEFILE_MULTIPOINT();
59  
60   /**
61    * DOCUMENT ME!
62    *
63    * @todo FIELD_DESCRIPTION
64    */
650  public static final int MS_SHP_POINTM = MapScriptJNI.get_MS_SHP_POINTM();
66  
67   /**
68    * DOCUMENT ME!
69    *
70    * @todo FIELD_DESCRIPTION
71    */
720  public static final int MS_SHP_ARCM = MapScriptJNI.get_MS_SHP_ARCM();
73  
74   /**
75    * DOCUMENT ME!
76    *
77    * @todo FIELD_DESCRIPTION
78    */
790  public static final int MS_SHP_POLYGONM = MapScriptJNI.get_MS_SHP_POLYGONM();
80  
81   /**
82    * DOCUMENT ME!
83    *
84    * @todo FIELD_DESCRIPTION
85    */
860  public static final int MS_SHP_MULTIPOINTM = MapScriptJNI.get_MS_SHP_MULTIPOINTM();
87  
88   /**
89    * DOCUMENT ME!
90    *
91    * @todo FIELD_DESCRIPTION
92    */
930  public static final int FTString = MapScriptJNI.get_FTString();
94  
95   /**
96    * DOCUMENT ME!
97    *
98    * @todo FIELD_DESCRIPTION
99    */
1000  public static final int FTInteger = MapScriptJNI.get_FTInteger();
101  
102   /**
103    * DOCUMENT ME!
104    *
105    * @todo FIELD_DESCRIPTION
106    */
1070  public static final int FTDouble = MapScriptJNI.get_FTDouble();
108  
109   /**
110    * DOCUMENT ME!
111    *
112    * @todo FIELD_DESCRIPTION
113    */
1140  public static final int FTInvalid = MapScriptJNI.get_FTInvalid();
115  
116   /**
117    * DOCUMENT ME!
118    *
119    * @todo FIELD_DESCRIPTION
120    */
1210  public static final String MS_VERSION = MapScriptJNI.get_MS_VERSION();
122  
123   /**
124    * DOCUMENT ME!
125    *
126    * @todo FIELD_DESCRIPTION
127    */
1280  public static final int MS_TRUE = MapScriptJNI.get_MS_TRUE();
129  
130   /**
131    * DOCUMENT ME!
132    *
133    * @todo FIELD_DESCRIPTION
134    */
1350  public static final int MS_FALSE = MapScriptJNI.get_MS_FALSE();
136  
137   /**
138    * DOCUMENT ME!
139    *
140    * @todo FIELD_DESCRIPTION
141    */
1420  public static final int MS_ON = MapScriptJNI.get_MS_ON();
143  
144   /**
145    * DOCUMENT ME!
146    *
147    * @todo FIELD_DESCRIPTION
148    */
1490  public static final int MS_OFF = MapScriptJNI.get_MS_OFF();
150  
151   /**
152    * DOCUMENT ME!
153    *
154    * @todo FIELD_DESCRIPTION
155    */
1560  public static final int MS_DEFAULT = MapScriptJNI.get_MS_DEFAULT();
157  
158   /**
159    * DOCUMENT ME!
160    *
161    * @todo FIELD_DESCRIPTION
162    */
1630  public static final int MS_EMBED = MapScriptJNI.get_MS_EMBED();
164  
165   /**
166    * DOCUMENT ME!
167    *
168    * @todo FIELD_DESCRIPTION
169    */
1700  public static final int MS_DELETE = MapScriptJNI.get_MS_DELETE();
171  
172   /**
173    * DOCUMENT ME!
174    *
175    * @todo FIELD_DESCRIPTION
176    */
1770  public static final int MS_YES = MapScriptJNI.get_MS_YES();
178  
179   /**
180    * DOCUMENT ME!
181    *
182    * @todo FIELD_DESCRIPTION
183    */
1840  public static final int MS_NO = MapScriptJNI.get_MS_NO();
185  
186   /**
187    * DOCUMENT ME!
188    *
189    * @todo FIELD_DESCRIPTION
190    */
1910  public static final int MS_SINGLE = MapScriptJNI.get_MS_SINGLE();
192  
193   /**
194    * DOCUMENT ME!
195    *
196    * @todo FIELD_DESCRIPTION
197    */
1980  public static final int MS_MULTIPLE = MapScriptJNI.get_MS_MULTIPLE();
199  
200   /**
201    * DOCUMENT ME!
202    *
203    * @todo FIELD_DESCRIPTION
204    */
2050  public static final int MS_FILE_MAP = MapScriptJNI.get_MS_FILE_MAP();
206  
207   /**
208    * DOCUMENT ME!
209    *
210    * @todo FIELD_DESCRIPTION
211    */
2120  public static final int MS_FILE_SYMBOL = MapScriptJNI.get_MS_FILE_SYMBOL();
213  
214   /**
215    * DOCUMENT ME!
216    *
217    * @todo FIELD_DESCRIPTION
218    */
2190  public static final int MS_INCHES = MapScriptJNI.get_MS_INCHES();
220  
221   /**
222    * DOCUMENT ME!
223    *
224    * @todo FIELD_DESCRIPTION
225    */
2260  public static final int MS_FEET = MapScriptJNI.get_MS_FEET();
227  
228   /**
229    * DOCUMENT ME!
230    *
231    * @todo FIELD_DESCRIPTION
232    */
2330  public static final int MS_MILES = MapScriptJNI.get_MS_MILES();
234  
235   /**
236    * DOCUMENT ME!
237    *
238    * @todo FIELD_DESCRIPTION
239    */
2400  public static final int MS_METERS = MapScriptJNI.get_MS_METERS();
241  
242   /**
243    * DOCUMENT ME!
244    *
245    * @todo FIELD_DESCRIPTION
246    */
2470  public static final int MS_KILOMETERS = MapScriptJNI.get_MS_KILOMETERS();
248  
249   /**
250    * DOCUMENT ME!
251    *
252    * @todo FIELD_DESCRIPTION
253    */
2540  public static final int MS_DD = MapScriptJNI.get_MS_DD();
255  
256   /**
257    * DOCUMENT ME!
258    *
259    * @todo FIELD_DESCRIPTION
260    */
2610  public static final int MS_PIXELS = MapScriptJNI.get_MS_PIXELS();
262  
263   /**
264    * DOCUMENT ME!
265    *
266    * @todo FIELD
267    */
2680  public static final double[] inchesPerUnit =
269   {
270     1, 12, 63360.0, 39.3701, 39370.1, 4374754
271   };
272  
273   /**
274    * DOCUMENT ME!
275    *
276    * @todo FIELD_DESCRIPTION
277    */
2780  public static final int MS_SHAPE_POINT = MapScriptJNI.get_MS_SHAPE_POINT();
279  
280   /**
281    * DOCUMENT ME!
282    *
283    * @todo FIELD_DESCRIPTION
284    */
2850  public static final int MS_SHAPE_LINE = MapScriptJNI.get_MS_SHAPE_LINE();
286  
287   /**
288    * DOCUMENT ME!
289    *
290    * @todo FIELD_DESCRIPTION
291    */
2920  public static final int MS_SHAPE_POLYGON = MapScriptJNI.get_MS_SHAPE_POLYGON();
293  
294   /**
295    * DOCUMENT ME!
296    *
297    * @todo FIELD_DESCRIPTION
298    */
2990  public static final int MS_SHAPE_NULL = MapScriptJNI.get_MS_SHAPE_NULL();
300  
301   /**
302    * DOCUMENT ME!
303    *
304    * @todo FIELD_DESCRIPTION
305    */
3060  public static final int MS_LAYER_POINT = MapScriptJNI.get_MS_LAYER_POINT();
307  
308   /**
309    * DOCUMENT ME!
310    *
311    * @todo FIELD_DESCRIPTION
312    */
3130  public static final int MS_LAYER_LINE = MapScriptJNI.get_MS_LAYER_LINE();
314  
315   /**
316    * DOCUMENT ME!
317    *
318    * @todo FIELD_DESCRIPTION
319    */
3200  public static final int MS_LAYER_POLYGON = MapScriptJNI.get_MS_LAYER_POLYGON();
321  
322   /**
323    * DOCUMENT ME!
324    *
325    * @todo FIELD_DESCRIPTION
326    */
3270  public static final int MS_LAYER_RASTER = MapScriptJNI.get_MS_LAYER_RASTER();
328  
329   /**
330    * DOCUMENT ME!
331    *
332    * @todo FIELD_DESCRIPTION
333    */
3340  public static final int MS_LAYER_ANNOTATION = MapScriptJNI.get_MS_LAYER_ANNOTATION();
335  
336   /**
337    * DOCUMENT ME!
338    *
339    * @todo FIELD_DESCRIPTION
340    */
3410  public static final int MS_LAYER_QUERY = MapScriptJNI.get_MS_LAYER_QUERY();
342  
343   /**
344    * DOCUMENT ME!
345    *
346    * @todo FIELD_DESCRIPTION
347    */
3480  public static final int MS_LAYER_CIRCLE = MapScriptJNI.get_MS_LAYER_CIRCLE();
349  
350   /**
351    * DOCUMENT ME!
352    *
353    * @todo FIELD_DESCRIPTION
354    */
3550  public static final int MS_TRUETYPE = MapScriptJNI.get_MS_TRUETYPE();
356  
357   /**
358    * DOCUMENT ME!
359    *
360    * @todo FIELD_DESCRIPTION
361    */
3620  public static final int MS_BITMAP = MapScriptJNI.get_MS_BITMAP();
363  
364   /**
365    * DOCUMENT ME!
366    *
367    * @todo FIELD_DESCRIPTION
368    */
3690  public static final int MS_UL = MapScriptJNI.get_MS_UL();
370  
371   /**
372    * DOCUMENT ME!
373    *
374    * @todo FIELD_DESCRIPTION
375    */
3760  public static final int MS_LR = MapScriptJNI.get_MS_LR();
377  
378   /**
379    * DOCUMENT ME!
380    *
381    * @todo FIELD_DESCRIPTION
382    */
3830  public static final int MS_UR = MapScriptJNI.get_MS_UR();
384  
385   /**
386    * DOCUMENT ME!
387    *
388    * @todo FIELD_DESCRIPTION
389    */
3900  public static final int MS_LL = MapScriptJNI.get_MS_LL();
391  
392   /**
393    * DOCUMENT ME!
394    *
395    * @todo FIELD_DESCRIPTION
396    */
3970  public static final int MS_CR = MapScriptJNI.get_MS_CR();
398  
399   /**
400    * DOCUMENT ME!
401    *
402    * @todo FIELD_DESCRIPTION
403    */
4040  public static final int MS_CL = MapScriptJNI.get_MS_CL();
405  
406   /**
407    * DOCUMENT ME!
408    *
409    * @todo FIELD_DESCRIPTION
410    */
4110  public static final int MS_UC = MapScriptJNI.get_MS_UC();
412  
413   /**
414    * DOCUMENT ME!
415    *
416    * @todo FIELD_DESCRIPTION
417    */
4180  public static final int MS_LC = MapScriptJNI.get_MS_LC();
419  
420   /**
421    * DOCUMENT ME!
422    *
423    * @todo FIELD_DESCRIPTION
424    */
4250  public static final int MS_CC = MapScriptJNI.get_MS_CC();
426  
427   /**
428    * DOCUMENT ME!
429    *
430    * @todo FIELD_DESCRIPTION
431    */
4320  public static final int MS_AUTO = MapScriptJNI.get_MS_AUTO();
433  
434   /**
435    * DOCUMENT ME!
436    *
437    * @todo FIELD_DESCRIPTION
438    */
4390  public static final int MS_XY = MapScriptJNI.get_MS_XY();
440  
441   /**
442    * DOCUMENT ME!
443    *
444    * @todo FIELD_DESCRIPTION
445    */
4460  public static final int MS_TINY = MapScriptJNI.get_MS_TINY();
447  
448   /**
449    * DOCUMENT ME!
450    *
451    * @todo FIELD_DESCRIPTION
452    */
4530  public static final int MS_SMALL = MapScriptJNI.get_MS_SMALL();
454  
455   /**
456    * DOCUMENT ME!
457    *
458    * @todo FIELD_DESCRIPTION
459    */
4600  public static final int MS_MEDIUM = MapScriptJNI.get_MS_MEDIUM();
461  
462   /**
463    * DOCUMENT ME!
464    *
465    * @todo FIELD_DESCRIPTION
466    */
4670  public static final int MS_LARGE = MapScriptJNI.get_MS_LARGE();
468  
469   /**
470    * DOCUMENT ME!
471    *
472    * @todo FIELD_DESCRIPTION
473    */
4740  public static final int MS_GIANT = MapScriptJNI.get_MS_GIANT();
475  
476   /**
477    * DOCUMENT ME!
478    *
479    * @todo FIELD_DESCRIPTION
480    */
4810  public static final int MS_NORMAL = MapScriptJNI.get_MS_NORMAL();
482  
483   /**
484    * DOCUMENT ME!
485    *
486    * @todo FIELD_DESCRIPTION
487    */
4880  public static final int MS_HILITE = MapScriptJNI.get_MS_HILITE();
489  
490   /**
491    * DOCUMENT ME!
492    *
493    * @todo FIELD_DESCRIPTION
494    */
4950  public static final int MS_SELECTED = MapScriptJNI.get_MS_SELECTED();
496  
497   /**
498    * DOCUMENT ME!
499    *
500    * @todo FIELD_DESCRIPTION
501    */
5020  public static final int MS_INLINE = MapScriptJNI.get_MS_INLINE();
503  
504   /**
505    * DOCUMENT ME!
506    *
507    * @todo FIELD_DESCRIPTION
508    */
5090  public static final int MS_SHAPEFILE = MapScriptJNI.get_MS_SHAPEFILE();
510  
511   /**
512    * DOCUMENT ME!
513    *
514    * @todo FIELD_DESCRIPTION
515    */
5160  public static final int MS_TILED_SHAPEFILE = MapScriptJNI.get_MS_TILED_SHAPEFILE();
517  
518   /**
519    * DOCUMENT ME!
520    *
521    * @todo FIELD_DESCRIPTION
522    */
5230  public static final int MS_SDE = MapScriptJNI.get_MS_SDE();
524  
525   /**
526    * DOCUMENT ME!
527    *
528    * @todo FIELD_DESCRIPTION
529    */
5300  public static final int MS_OGR = MapScriptJNI.get_MS_OGR();
531  
532   /**
533    * DOCUMENT ME!
534    *
535    * @todo FIELD_DESCRIPTION
536    */
5370  public static final int MS_UNUSED_1 = MapScriptJNI.get_MS_UNUSED_1();
538  
539   /**
540    * DOCUMENT ME!
541    *
542    * @todo FIELD_DESCRIPTION
543    */
5440  public static final int MS_POSTGIS = MapScriptJNI.get_MS_POSTGIS();
545  
546   /**
547    * DOCUMENT ME!
548    *
549    * @todo FIELD_DESCRIPTION
550    */
5510  public static final int MS_WMS = MapScriptJNI.get_MS_WMS();
552  
553   /**
554    * DOCUMENT ME!
555    *
556    * @todo FIELD_DESCRIPTION
557    */
5580  public static final int MS_ORACLESPATIAL = MapScriptJNI.get_MS_ORACLESPATIAL();
559  
560   /**
561    * DOCUMENT ME!
562    *
563    * @todo FIELD_DESCRIPTION
564    */
5650  public static final int MS_GIF = MapScriptJNI.get_MS_GIF();
566  
567   /**
568    * DOCUMENT ME!
569    *
570    * @todo FIELD_DESCRIPTION
571    */
5720  public static final int MS_PNG = MapScriptJNI.get_MS_PNG();
573  
574   /**
575    * DOCUMENT ME!
576    *
577    * @todo FIELD_DESCRIPTION
578    */
5790  public static final int MS_JPEG = MapScriptJNI.get_MS_JPEG();
580  
581   /**
582    * DOCUMENT ME!
583    *
584    * @todo FIELD_DESCRIPTION
585    */
5860  public static final int MS_WBMP = MapScriptJNI.get_MS_WBMP();
587  
588   /**
589    * DOCUMENT ME!
590    *
591    * @todo FIELD_DESCRIPTION
592    */
5930  public static final int MS_GML = MapScriptJNI.get_MS_GML();
594  
595   /**
596    * DOCUMENT ME!
597    *
598    * @todo FIELD_DESCRIPTION
599    */
6000  public static final int MS_CJC_NONE = MapScriptJNI.get_MS_CJC_NONE();
601  
602   /**
603    * DOCUMENT ME!
604    *
605    * @todo FIELD_DESCRIPTION
606    */
6070  public static final int MS_CJC_BEVEL = MapScriptJNI.get_MS_CJC_BEVEL();
608  
609   /**
610    * DOCUMENT ME!
611    *
612    * @todo FIELD_DESCRIPTION
613    */
6140  public static final int MS_CJC_BUTT = MapScriptJNI.get_MS_CJC_BUTT();
615  
616   /**
617    * DOCUMENT ME!
618    *
619    * @todo FIELD_DESCRIPTION
620    */
6210  public static final int MS_CJC_MITER = MapScriptJNI.get_MS_CJC_MITER();
622  
623   /**
624    * DOCUMENT ME!
625    *
626    * @todo FIELD_DESCRIPTION
627    */
6280  public static final int MS_CJC_ROUND = MapScriptJNI.get_MS_CJC_ROUND();
629  
630   /**
631    * DOCUMENT ME!
632    *
633    * @todo FIELD_DESCRIPTION
634    */
6350  public static final int MS_CJC_SQUARE = MapScriptJNI.get_MS_CJC_SQUARE();
636  
637   /**
638    * DOCUMENT ME!
639    *
640    * @todo FIELD_DESCRIPTION
641    */
6420  public static final int MS_CJC_TRIANGLE = MapScriptJNI.get_MS_CJC_TRIANGLE();
643  
644   /**
645    * DOCUMENT ME!
646    *
647    * @todo FIELD_DESCRIPTION
648    */
6490  public static final int MS_SUCCESS = MapScriptJNI.get_MS_SUCCESS();
650  
651   /**
652    * DOCUMENT ME!
653    *
654    * @todo FIELD_DESCRIPTION
655    */
6560  public static final int MS_FAILURE = MapScriptJNI.get_MS_FAILURE();
657  
658   /**
659    * DOCUMENT ME!
660    *
661    * @todo FIELD_DESCRIPTION
662    */
6630  public static final int MS_DONE = MapScriptJNI.get_MS_DONE();
664  
665   /**
666    * DOCUMENT ME!
667    *
668    * @param rect PARAMETER
669    * @param width PARAMETER
670    * @param height PARAMETER
671    *
672    * @return RETURN
673    *
674    * @todo METHOD
675    */
676   public static double AdjustExtent(rectObj rect, int width, int height)
677   {
678     double cellsize;
679     double ox;
680     double oy;
681  
6820    cellsize = Math.max((rect.getMaxx() - rect.getMinx()) / (width - 1),
683         (rect.getMaxy() - rect.getMiny()) / (height - 1));
684  
685     // avoid division by zero errors
6860    if (cellsize <= 0)
687     {
6880      return 0;
689     }
690  
6910    ox = Math.round(Math.max(
692           ((width - 1) - ((rect.getMaxx() - rect.getMinx()) / cellsize)) / 2, 0));
6930    oy = Math.round(Math.max(
694           ((height - 1) - ((rect.getMaxy() - rect.getMiny()) / cellsize)) / 2, 0));
695  
6960    rect.setMinx(rect.getMinx() - (ox * cellsize));
6970    rect.setMiny(rect.getMiny() - (oy * cellsize));
6980    rect.setMaxx(rect.getMaxx() + (ox * cellsize));
6990    rect.setMaxy(rect.getMaxy() + (oy * cellsize));
700  
7010    return cellsize;
702   }
703  
704   /**
705    * DOCUMENT ME!
706    *
707    * @param extent PARAMETER
708    * @param units PARAMETER
709    * @param width PARAMETER
710    * @param height PARAMETER
711    * @param resolution PARAMETER
712    *
713    * @return RETURN
714    *
715    * @todo METHOD
716    */
717   public static double CalculateScale(rectObj extent, int units, int width,
718     int height, int resolution)
719   {
720     double scale;
721     double md;
722     double gd;
723  
7240    if ((width <= 0) || (height <= 0))
725     {
7260      System.out.println("CalculateScale : Invalid image width or height.");
727  
7280      return (-1);
729     }
730  
7310    System.out.println("units=[" + units + "]");
7320    System.out.println("inchesPerUnit=[" + inchesPerUnit[units] + "]");
733  
7340    if ((units == MapScript.MS_DD) || (units == MapScript.MS_METERS) ||
735         (units == MapScript.MS_KILOMETERS) || (units == MapScript.MS_MILES) ||
736         (units == MapScript.MS_INCHES) || (units == MapScript.MS_FEET))
737     {
7380      md = width / (resolution * inchesPerUnit[units]); // was (width-1)
7390      gd = extent.getMaxx() - extent.getMinx();
7400      scale = gd / md;
741     }
742     else
743     {
7440      scale = -1; // this is not an error
745     }
746  
7470    System.out.println("scale=[" + Double.toString(scale) + "]");
748  
7490    return scale;
750   }
751  
752   /**
753    * DOCUMENT ME!
754    *
755    * @param dfScale PARAMETER
756    * @param units PARAMETER
757    * @param nWidth PARAMETER
758    * @param resolution PARAMETER
759    *
760    * @return RETURN
761    *
762    * @todo METHOD
763    */
764   public static double GetDeltaExtentsUsingScale(double dfScale, int units,
765     int nWidth, int resolution)
766   {
7670    double md = 0.0;
7680    double dfDelta = -1.0;
769  
7700    if ((dfScale <= 0) || (nWidth <= 0))
771     {
7720      return -1;
773     }
774  
7750    System.out.println("units=[" + units + "]");
7760    System.out.println("inchesPerUnit=[" + inchesPerUnit[units] + "]");
777  
7780    if ((units == MapScript.MS_DD) || (units == MapScript.MS_METERS) ||
779         (units == MapScript.MS_KILOMETERS) || (units == MapScript.MS_MILES) ||
780         (units == MapScript.MS_INCHES) || (units == MapScript.MS_FEET))
781     {
7820      md = nWidth / (resolution * inchesPerUnit[units]);
7830      dfDelta = md * dfScale;
784     }
785     else
786     {
787       // nothing
788     }
789  
7900    System.out.println("dfDelta=[" + dfDelta + "]");
791  
7920    return dfDelta;
793   }
794  
795   /**
796    * DOCUMENT ME!
797    *
798    * @param psProj PARAMETER
799    *
800    * @return RETURN
801    *
802    * @todo METHOD_DESCRIPTION
803    */
804   public static int GetMapserverUnitUsingProj(projectionObj psProj)
805   {
8060    return MapScriptJNI.GetMapserverUnitUsingProj(projectionObj.getCPtr(psProj));
807   }
808  
809   /**
810    * DOCUMENT ME!
811    *
812    * @param nPixPos PARAMETER
813    * @param nPixMin PARAMETER
814    * @param nPixMax PARAMETER
815    * @param dfGeoMin PARAMETER
816    * @param dfGeoMax PARAMETER
817    * @param bULisYOrig PARAMETER
818    *
819    * @return RETURN
820    *
821    * @todo METHOD
822    */
823   public static double Pix2Georef(int nPixPos, int nPixMin, int nPixMax,
824     double dfGeoMin, double dfGeoMax, boolean bULisYOrig)
825   {
8260    double dfWidthGeo = 0.0;
8270    int nWidthPix = 0;
8280    double dfPixToGeo = 0.0;
8290    double dfPosGeo = 0.0;
8300    double dfDeltaGeo = 0.0;
8310    int nDeltaPix = 0;
832  
8330    dfWidthGeo = dfGeoMax - dfGeoMin;
8340    nWidthPix = nPixMax - nPixMin;
835  
8360    if ((dfWidthGeo > 0.0) && (nWidthPix > 0))
837     {
8380      dfPixToGeo = dfWidthGeo / (double) nWidthPix;
839  
8400      if (!bULisYOrig)
841       {
8420        nDeltaPix = nPixPos - nPixMin;
843       }
844       else
845       {
8460        nDeltaPix = nPixMax - nPixPos;
847       }
848  
8490      dfDeltaGeo = nDeltaPix * dfPixToGeo;
850  
8510      dfPosGeo = dfGeoMin + dfDeltaGeo;
852     }
853  
8540    return dfPosGeo;
855   }
856  
857   /**
858    * DOCUMENT ME!
859    *
860    * @param hDBF PARAMETER
861    * @param pszFieldName PARAMETER
862    * @param eType PARAMETER
863    * @param nWidth PARAMETER
864    * @param nDecimals PARAMETER
865    *
866    * @return RETURN
867    *
868    * @todo METHOD_DESCRIPTION
869    */
870   public static int msDBFAddField(DBFInfo hDBF, String pszFieldName, int eType,
871     int nWidth, int nDecimals)
872   {
8730    return MapScriptJNI.msDBFAddField(DBFInfo.getCPtr(hDBF), pszFieldName,
874       eType, nWidth, nDecimals);
875   }
876  
877   /**
878    * DOCUMENT ME!
879    *
880    * @param hDBF PARAMETER
881    *
882    * @todo METHOD_DESCRIPTION
883    */
884   public static void msDBFClose(DBFInfo hDBF)
885   {
8860    MapScriptJNI.msDBFClose(DBFInfo.getCPtr(hDBF));
8870  }
888  
889   /**
890    * DOCUMENT ME!
891    *
892    * @param pszDBFFile PARAMETER
893    *
894    * @return RETURN
895    *
896    * @todo METHOD_DESCRIPTION
897    */
898   public static DBFInfo msDBFCreate(String pszDBFFile)
899   {
9000    return new DBFInfo(MapScriptJNI.msDBFCreate(pszDBFFile), false);
901   }
902  
903   /**
904    * DOCUMENT ME!
905    *
906    * @param psDBF PARAMETER
907    *
908    * @return RETURN
909    *
910    * @todo METHOD_DESCRIPTION
911    */
912   public static int msDBFGetFieldCount(DBFInfo psDBF)
913   {
9140    return MapScriptJNI.msDBFGetFieldCount(DBFInfo.getCPtr(psDBF));
915   }
916  
917   /**
918    * DOCUMENT ME!
919    *
920    * @param psDBF PARAMETER
921    * @param iField PARAMETER
922    * @param pszFieldName PARAMETER
923    * @param pnWidth PARAMETER
924    * @param pnDecimals PARAMETER
925    *
926    * @return RETURN
927    *
928    * @todo METHOD_DESCRIPTION
929    */
930   public static int msDBFGetFieldInfo(DBFInfo psDBF, int iField,
931     String pszFieldName, SWIGTYPE_p_int pnWidth, SWIGTYPE_p_int pnDecimals)
932   {
9330    return MapScriptJNI.msDBFGetFieldInfo(DBFInfo.getCPtr(psDBF), iField,
934       pszFieldName, SWIGTYPE_p_int.getCPtr(pnWidth),
935       SWIGTYPE_p_int.getCPtr(pnDecimals));
936   }
937  
938   /**
939    * DOCUMENT ME!
940    *
941    * @param dbffile PARAMETER
942    * @param name PARAMETER
943    *
944    * @return RETURN
945    *
946    * @todo METHOD_DESCRIPTION
947    */
948   public static int msDBFGetItemIndex(DBFInfo dbffile, String name)
949   {
9500    return MapScriptJNI.msDBFGetItemIndex(DBFInfo.getCPtr(dbffile), name);
951   }
952  
953   /**
954    * DOCUMENT ME!
955    *
956    * @param dbffile PARAMETER
957    * @param items PARAMETER
958    * @param numitems PARAMETER
959    *
960    * @return RETURN
961    *
962    * @todo METHOD_DESCRIPTION
963    */
964   public static SWIGTYPE_p_int msDBFGetItemIndexes(DBFInfo dbffile,
965     SWIGTYPE_p_p_char items, int numitems)
966   {
9670    return new SWIGTYPE_p_int(MapScriptJNI.msDBFGetItemIndexes(DBFInfo.getCPtr(
968           dbffile), SWIGTYPE_p_p_char.getCPtr(items), numitems), false);
969   }
970  
971   /**
972    * DOCUMENT ME!
973    *
974    * @param dbffile PARAMETER
975    *
976    * @return RETURN
977    *
978    * @todo METHOD_DESCRIPTION
979    */
980   public static SWIGTYPE_p_p_char msDBFGetItems(DBFInfo dbffile)
981   {
9820    return new SWIGTYPE_p_p_char(MapScriptJNI.msDBFGetItems(DBFInfo.getCPtr(
983           dbffile)), false);
984   }
985  
986   /**
987    * DOCUMENT ME!
988    *
989    * @param psDBF PARAMETER
990    *
991    * @return RETURN
992    *
993    * @todo METHOD_DESCRIPTION
994    */
995   public static int msDBFGetRecordCount(DBFInfo psDBF)
996   {
9970    return MapScriptJNI.msDBFGetRecordCount(DBFInfo.getCPtr(psDBF));
998   }
999  
1000   /**
1001    * DOCUMENT ME!
1002    *
1003    * @param dbffile PARAMETER
1004    * @param record PARAMETER
1005    * @param itemindexes PARAMETER
1006    * @param numitems PARAMETER
1007    *
1008    * @return RETURN
1009    *
1010    * @todo METHOD_DESCRIPTION
1011    */
1012   public static SWIGTYPE_p_p_char msDBFGetValueList(DBFInfo dbffile,
1013     int record, SWIGTYPE_p_int itemindexes, int numitems)
1014   {
10150    return new SWIGTYPE_p_p_char(MapScriptJNI.msDBFGetValueList(DBFInfo.getCPtr(
1016           dbffile), record, SWIGTYPE_p_int.getCPtr(itemindexes), numitems),
1017       false);
1018   }
1019  
1020   /**
1021    * DOCUMENT ME!
1022    *
1023    * @param dbffile PARAMETER
1024    * @param record PARAMETER
1025    *
1026    * @return RETURN
1027    *
1028    * @todo METHOD_DESCRIPTION
1029    */
1030   public static SWIGTYPE_p_p_char msDBFGetValues(DBFInfo dbffile, int record)
1031   {
10320    return new SWIGTYPE_p_p_char(MapScriptJNI.msDBFGetValues(DBFInfo.getCPtr(
1033           dbffile), record), false);
1034   }
1035  
1036   /**
1037    * DOCUMENT ME!
1038    *
1039    * @param pszDBFFile PARAMETER
1040    * @param pszAccess PARAMETER
1041    *
1042    * @return RETURN
1043    *
1044    * @todo METHOD_DESCRIPTION
1045    */
1046   public static DBFInfo msDBFOpen(String pszDBFFile, String pszAccess)
1047   {
10480    return new DBFInfo(MapScriptJNI.msDBFOpen(pszDBFFile, pszAccess), false);
1049   }
1050  
1051   /**
1052    * DOCUMENT ME!
1053    *
1054    * @param hDBF PARAMETER
1055    * @param iShape PARAMETER
1056    * @param iField PARAMETER
1057    *
1058    * @return RETURN
1059    *
1060    * @todo METHOD_DESCRIPTION
1061    */
1062   public static double msDBFReadDoubleAttribute(DBFInfo hDBF, int iShape,
1063     int iField)
1064   {
10650    return MapScriptJNI.msDBFReadDoubleAttribute(DBFInfo.getCPtr(hDBF), iShape,
1066       iField);
1067   }
1068  
1069   /**
1070    * DOCUMENT ME!
1071    *
1072    * @param hDBF PARAMETER
1073    * @param iShape PARAMETER
1074    * @param iField PARAMETER
1075    *
1076    * @return RETURN
1077    *
1078    * @todo METHOD_DESCRIPTION
1079    */
1080   public static int msDBFReadIntegerAttribute(DBFInfo hDBF, int iShape,
1081     int iField)
1082   {
10830    return MapScriptJNI.msDBFReadIntegerAttribute(DBFInfo.getCPtr(hDBF),
1084       iShape, iField);
1085   }
1086  
1087   /**
1088    * DOCUMENT ME!
1089    *
1090    * @param hDBF PARAMETER
1091    * @param iShape PARAMETER
1092    * @param iField PARAMETER
1093    *
1094    * @return RETURN
1095    *
1096    * @todo METHOD_DESCRIPTION
1097    */
1098   public static String msDBFReadStringAttribute(DBFInfo hDBF, int iShape,
1099     int iField)
1100   {
11010    return MapScriptJNI.msDBFReadStringAttribute(DBFInfo.getCPtr(hDBF), iShape,
1102       iField);
1103   }
1104  
1105   /**
1106    * DOCUMENT ME!
1107    *
1108    * @param hDBF PARAMETER
1109    * @param iShape PARAMETER
1110    * @param iField PARAMETER
1111    * @param dFieldValue PARAMETER
1112    *
1113    * @return RETURN
1114    *
1115    * @todo METHOD_DESCRIPTION
1116    */
1117   public static int msDBFWriteDoubleAttribute(DBFInfo hDBF, int iShape,
1118     int iField, double dFieldValue)
1119   {
11200    return MapScriptJNI.msDBFWriteDoubleAttribute(DBFInfo.getCPtr(hDBF),
1121       iShape, iField, dFieldValue);
1122   }
1123  
1124   /**
1125    * DOCUMENT ME!
1126    *
1127    * @param hDBF PARAMETER
1128    * @param iShape PARAMETER
1129    * @param iField PARAMETER
1130    * @param nFieldValue PARAMETER
1131    *
1132    * @return RETURN
1133    *
1134    * @todo METHOD_DESCRIPTION
1135    */
1136   public static int msDBFWriteIntegerAttribute(DBFInfo hDBF, int iShape,
1137     int iField, int nFieldValue)
1138   {
11390    return MapScriptJNI.msDBFWriteIntegerAttribute(DBFInfo.getCPtr(hDBF),
1140       iShape, iField, nFieldValue);
1141   }
1142  
1143   /**
1144    * DOCUMENT ME!
1145    *
1146    * @param hDBF PARAMETER
1147    * @param iShape PARAMETER
1148    * @param iField PARAMETER
1149    * @param pszFieldValue PARAMETER
1150    *
1151    * @return RETURN
1152    *
1153    * @todo METHOD_DESCRIPTION
1154    */
1155   public static int msDBFWriteStringAttribute(DBFInfo hDBF, int iShape,
1156     int iField, String pszFieldValue)
1157   {
11580    return MapScriptJNI.msDBFWriteStringAttribute(DBFInfo.getCPtr(hDBF),
1159       iShape, iField, pszFieldValue);
1160   }
1161  
1162   /**
1163    * DOCUMENT ME!
1164    *
1165    * @param img PARAMETER
1166    *
1167    * @todo METHOD_DESCRIPTION
1168    */
1169   public static void msFreeImage(SWIGTYPE_p_gdImagePtr img)
1170   {
11710    MapScriptJNI.msFreeImage(SWIGTYPE_p_gdImagePtr.getCPtr(img));
11720  }
1173  
1174   /**
1175    * DOCUMENT ME!
1176    *
1177    * @param img PARAMETER
1178    * @param filename PARAMETER
1179    * @param type PARAMETER
1180    * @param transparent PARAMETER
1181    * @param interlace PARAMETER
1182    * @param quality PARAMETER
1183    *
1184    * @return RETURN
1185    *
1186    * @todo METHOD_DESCRIPTION
1187    */
1188   public static int msSaveImage(SWIGTYPE_p_gdImagePtr img, String filename,
1189     int type, int transparent, int interlace, int quality)
1190   {
11910    return MapScriptJNI.msSaveImage(SWIGTYPE_p_gdImagePtr.getCPtr(img),
1192       filename, type, transparent, interlace, quality);
1193   }
1194 }

this report was generated by version 1.0.2 of jcoverage.
visit www.jcoverage.com for updates.

copyright © 2003, jcoverage ltd. all rights reserved.
Java is a trademark of Sun Microsystems, Inc. in the United States and other countries.