rdf4j-postgis  Version 0.1.0.0
GARStoLL Class Reference

https://github.com/mil-oss/GARSutils MIT License More...

Static Public Member Functions

static String getCenterKMLCoords (String GARS)
 Convert a GARS string to KML STRING representation of the center coordinates. More...
 
static String getCenterJSONCoords (String GARS)
 Convert a GARS string to JSON representation of the center coordinates. More...
 
static String getCenterCoords (String GARS)
 Convert a GARS string to STRING representation of the center coordinates. More...
 
static double[] getCenterCoordsArray (String GARS)
 Convert a GARS string to double array containing latitude and longitude. More...
 
static double[] getCornerCoordsArray (String GARS)
 Convert a GARS string to double array containing latitude and longitude coordinates of the lower left and upper right corners of the GARS tile. More...
 
static String getCornerJSONCoords (String GARS)
 Convert a GARS string to JSON representation of the corner coordinates. More...
 
static String getKMLLine (String GARS, String kmlColor, double kmlWidth)
 Convert a GARS String to a KML Placemark fragment representing the GARS tile as a line. More...
 
static String getKMLPolygon (String GARS, String kmlColor, String kmlFillColor, double kmlWidth)
 Convert a GARS String to a KML Placemark fragment representing the GARS tile as a filled polygon. More...
 
static String getKMLPoint (String GARS, String lblColor, double lblSize)
 Convert a GARS String to a KML Placemark fragment depicting the GARS string as a label in the center of the GARS tile. More...
 

Detailed Description

https://github.com/mil-oss/GARSutils MIT License

Author
marty

Member Function Documentation

◆ getCenterCoords()

static String getCenterCoords ( String  GARS)
static

Convert a GARS string to STRING representation of the center coordinates.

If the GARS string is invalid then the string 'error' is returned.
If the conversion was successful the center point of the GARS tile is returned in the format latitude,longitude. Latitude and longitude are in decimal degrees separated by a comma.

A typical result string looks like the following:
12.34567,123.45678

Parameters
GARSString
Returns
String
81  {
82  double[] ll = getCenterCoordsArray(GARS);
83  if (ll.length != 2) {
84  return "error";
85  }
86  StringBuilder latlon = new StringBuilder();
87  latlon.append(ll[0]).append(",").append(ll[1]);
88 
89  return latlon.toString();
90 
91  }//getCenterCoords
static double[] getCenterCoordsArray(String GARS)
Convert a GARS string to double array containing latitude and longitude.
Definition: GARStoLL.java:109

References GARStoLL.getCenterCoordsArray().

Referenced by GARStoLL.getCenterJSONCoords().

◆ getCenterCoordsArray()

static double [] getCenterCoordsArray ( String  GARS)
static

Convert a GARS string to double array containing latitude and longitude.


This code is a port of the NGA's geotrans cpp routines from the GEOTRANS 3.5 SDK: http://earth-info.nga.mil/GandG/geotrans/

If the GARS string is invalid then the returned array has a length of 1 and the first and only value will be -360
If the conversion was successful the center point of the GARS tile is returned as decimal degrees. The first value (index 0) holds latitude, the second value is longitude.
Check the length of the array for error checking, the length of a successful transformation will equal 2.

Parameters
GARSString
Returns
double[]
109  {
110  int GARS_MINIMUM = 5; // Minimum number of chars for GARS
111  int GARS_MAXIMUM = 7; // Maximum number of chars for GARS
112  int LETTER_A_OFFSET = 65; // Letter A offset in character set
113  double MIN_PER_DEG = 60; // Number of minutes per degree
114  double[] ll = new double[2];
115 
116  /* A = 0, B = 1, C = 2, D = 3, E = 4, F = 5, G = 6, H = 7 */
117  int LETTER_I = 8; /* ARRAY INDEX FOR LETTER I */
118  /* J = 9, K = 10, L = 11, M = 12, N = 13 */
119 
120  int LETTER_O = 14; /* ARRAY INDEX FOR LETTER O */
121  /* P = 15, Q = 16, R = 17, S = 18, T = 19, U = 20, V = 21, */
122  /* W = 22, X = 23, Y = 24, Z = 25 */
123 
124  char _1 = '1';
125  char _2 = '2';
126  char _3 = '3';
127  char _4 = '4';
128  char _5 = '5';
129  char _6 = '6';
130  char _7 = '7';
131  char _8 = '8';
132  char _9 = '9';
133 
134  char[] GARSString = GARS.toCharArray();
135  int lat = 0;
136  int lon = 1;
137  int gars_length = GARSString.length;
138  if ((gars_length < GARS_MINIMUM) || (gars_length > GARS_MAXIMUM)) {
139  ll = new double[1];
140  ll[0] = -360;
141  return ll;
142  }
143  String ew_string = "";
144  int index = 0;
145  while (isDigit(GARSString[index])) {
146  ew_string += GARSString[index];
147  index++;
148  }
149  //ERROR Checking longitude band, must be 3 digits
150  if (index != 3) {
151  ll = new double[1];
152  ll[0] = -360;
153  return ll;
154  }
155 
156  /* Get 30 minute east/west value, 1-720 */
157  Integer ew_value;
158  ew_value = Integer.parseInt(ew_string);
159 
160  char letter = ' ';
161  letter = GARSString[index];
162  if (!Character.isLetter(letter)) {
163  ll = new double[1];
164  ll[0] = -360;
165  return ll; // The latitude band must be a letter
166  }
167 
168  /* Get first 30 minute north/south letter, A-Q */
169  int[] ns_str = new int[3];
170  ns_str[0] = letter - LETTER_A_OFFSET;
171  letter = GARSString[++index];
172  if (!Character.isLetter(letter)) {
173  ll = new double[1];
174  ll[0] = -360;
175  return ll; // The latitude band must be a letter
176  }
177  /* Get second 30 minute north/south letter, A-Z */
178  ns_str[1] = letter - LETTER_A_OFFSET;
179 
180  char _15_minute_value = 0;
181  char _5_minute_value = 0;
182  if (index + 1 < gars_length) {
183  /* Get 15 minute quadrant value, 1-4 */
184  _15_minute_value = GARSString[++index];
185  //System.out.println("GARS " + GARS + " 15 MINUTE VAL: " + _15_minute_value);
186  if (!isDigit(_15_minute_value) || _15_minute_value < _1 || _15_minute_value > _4) {
187  ll = new double[1];
188  ll[0] = -360;
189  return ll;
190  } else {
191  if (index + 1 < gars_length) {
192  /* Get 5 minute quadrant value, 1-9 */
193  _5_minute_value = GARSString[++index];
194  //System.out.println("GARS " + GARS + " 5 MINUTE VAL: " + _5_minute_value);
195  if (!isDigit(_5_minute_value) || _5_minute_value < _1 || _5_minute_value > _9) {
196  ll = new double[1];
197  ll[0] = -360;
198  return ll;
199  }
200  }
201  }
202  }//
203 
204  double longitude = (((ew_value - 1.0) / 2.0) - 180.0);
205  /* Letter I and O are invalid */
206  if (ns_str[0] >= LETTER_O) {
207  ns_str[0]--;
208  }
209  if (ns_str[0] >= LETTER_I) {
210  ns_str[0]--;
211  }
212 
213  if (ns_str[1] >= LETTER_O) {
214  ns_str[1]--;
215  }
216  if (ns_str[1] >= LETTER_I) {
217  ns_str[1]--;
218  }
219 
220  double latitude = ((-90.0 + (ns_str[0] * 12.0)) + (ns_str[1] / 2.0));
221 
222  double lat_minutes = 0.0, lon_minutes = 0.0;
223 
224  //Strings in switch not allowed in Java 6
225  if (Character.toString(_15_minute_value).equals("1")) {
226  lat_minutes = 15.0;
227  } else if (Character.toString(_15_minute_value).equals("4")) {
228  lon_minutes = 15.0;
229  } else if (Character.toString(_15_minute_value).equals("2")) {
230  lat_minutes = 15.0;
231  lon_minutes = 15.0;
232  }
233 
234  if (Character.toString(_5_minute_value).equals("4")) {
235  lat_minutes += 5.0;
236  } else if (Character.toString(_5_minute_value).equals("1")) {
237  lat_minutes += 10.0;
238  } else if (Character.toString(_5_minute_value).equals("8")) {
239  lon_minutes += 5.0;
240  } else if (Character.toString(_5_minute_value).equals("5")) {
241  lon_minutes += 5.0;
242  lat_minutes += 5.0;
243  } else if (Character.toString(_5_minute_value).equals("2")) {
244  lon_minutes += 5.0;
245  lat_minutes += 10.0;
246  } else if (Character.toString(_5_minute_value).equals("9")) {
247  lon_minutes += 10.0;
248  } else if (Character.toString(_5_minute_value).equals("6")) {
249  lon_minutes += 10.0;
250  lat_minutes += 5.0;
251  } else if (Character.toString(_5_minute_value).equals("3")) {
252  lon_minutes += 10.0;
253  lat_minutes += 10.0;
254  }
255 
256  /* Add these values to force the reference point to be the center of the box */
257  if (_5_minute_value != 0) {
258  lat_minutes += 2.5;
259  lon_minutes += 2.5;
260  } else if (_15_minute_value != 0) {
261  lat_minutes += 7.5;
262  lon_minutes += 7.5;
263  } else {
264  lat_minutes += 15.0;
265  lon_minutes += 15.0;
266  }
267  latitude += lat_minutes / MIN_PER_DEG;
268  longitude += lon_minutes / MIN_PER_DEG;
269  ll[0] = latitude;
270  ll[1] = longitude;
271  return ll;
272 
273  }//getCenterCoordsArray

Referenced by GARStoLL.getCenterCoords(), GARStoLL.getCenterKMLCoords(), and GARStoLL.getKMLPoint().

◆ getCenterJSONCoords()

static String getCenterJSONCoords ( String  GARS)
static

Convert a GARS string to JSON representation of the center coordinates.

The JSON is will always return a status key with either "error" or "success".
If the conversion was successful then latitude and longitude keys are returned with decimal degrees values for the center point of the GARS tile.

A typical JSON string looks like the following:
{"status":"success","latitude":12.34567,"longitude":123.45678}

Parameters
GARSString
Returns
JSON String
55  {
56  String latlon = getCenterCoords(GARS);
57  if (latlon.toLowerCase().contains("error")) {
58  return "{\"status\":\"error\"}";
59  }
60  String[] ll = latlon.split(",");
61  StringBuilder json = new StringBuilder();
62  json.append("{\"status\":\"success\",\"latitude\":").append(ll[0]).append(",\"longitude\":").append(ll[1]).append("}");
63  return json.toString();
64 
65  }//getCenterJSONCoords
static String getCenterCoords(String GARS)
Convert a GARS string to STRING representation of the center coordinates.
Definition: GARStoLL.java:81

References GARStoLL.getCenterCoords().

◆ getCenterKMLCoords()

static String getCenterKMLCoords ( String  GARS)
static

Convert a GARS string to KML STRING representation of the center coordinates.

If the GARS string is invalid then an empty string is returned.
If the conversion was successful the center point of the GARS tile is returned in the format longitude,latitude. The coordinates are in decimal degrees separated by a comma.
Note: KML simply reverses the order of the coordinates and returns longitude first.

A typical result string looks like the following:
123.45678,12.34567

Parameters
GARSString
Returns
String
29  {
30  double[] ll = getCenterCoordsArray(GARS);
31  if (ll.length != 2) {
32  return "";
33  }
34  StringBuilder latlon = new StringBuilder();
35  latlon.append(ll[1]).append(",").append(ll[0]);
36 
37  return latlon.toString();
38  }//getCenterKmlCoords

References GARStoLL.getCenterCoordsArray().

◆ getCornerCoordsArray()

static double [] getCornerCoordsArray ( String  GARS)
static

Convert a GARS string to double array containing latitude and longitude coordinates of the lower left and upper right corners of the GARS tile.


This code is a port of the NGA's geotrans cpp routines from the GEOTRANS 3.5 SDK: http://earth-info.nga.mil/GandG/geotrans/

If the GARS string is invalid then the returned array has a length of 1 and the first and only value will be -360
If the conversion was successful the corner points of the GARS tile is returned as decimal degrees. The first value (index 0) holds latitude, the second value is longitude of the lower left corner. The third and fourth values hold the latitude and longitude of the upper right corner.
Check the length of the array for error checking, the length of a successful transformation will equal 4.

Parameters
GARS
Returns
double[]
294  {
295  int GARS_MINIMUM = 5; // Minimum number of chars for GARS
296  int GARS_MAXIMUM = 7; // Maximum number of chars for GARS
297  int LETTER_A_OFFSET = 65; // Letter A offset in character set
298  double MIN_PER_DEG = 60; // Number of minutes per degree
299  double[] ll = new double[4];
300 
301  /* A = 0, B = 1, C = 2, D = 3, E = 4, F = 5, G = 6, H = 7 */
302  int LETTER_I = 8; /* ARRAY INDEX FOR LETTER I */
303  /* J = 9, K = 10, L = 11, M = 12, N = 13 */
304 
305  int LETTER_O = 14; /* ARRAY INDEX FOR LETTER O */
306  /* P = 15, Q = 16, R = 17, S = 18, T = 19, U = 20, V = 21, */
307  /* W = 22, X = 23, Y = 24, Z = 25 */
308 
309  char _1 = '1';
310  char _2 = '2';
311  char _3 = '3';
312  char _4 = '4';
313  char _5 = '5';
314  char _6 = '6';
315  char _7 = '7';
316  char _8 = '8';
317  char _9 = '9';
318 
319  char[] GARSString = GARS.toCharArray();
320  int lat = 0;
321  int lon = 1;
322  int gars_length = GARSString.length;
323  if ((gars_length < GARS_MINIMUM) || (gars_length > GARS_MAXIMUM)) {
324  ll = new double[1];
325  ll[0] = -360;
326  return ll;
327  }
328  String ew_string = "";
329  int index = 0;
330  while (isDigit(GARSString[index])) {
331  ew_string += GARSString[index];
332  index++;
333  }
334  //ERROR Checking longitude band, must be 3 digits
335  if (index != 3) {
336  ll = new double[1];
337  ll[0] = -360;
338  return ll;
339  }
340 
341  /* Get 30 minute east/west value, 1-720 */
342  Integer ew_value;
343  ew_value = Integer.parseInt(ew_string);
344 
345  char letter = ' ';
346  letter = GARSString[index];
347  if (!Character.isLetter(letter)) {
348  ll = new double[1];
349  ll[0] = -360;
350  return ll; // The latitude band must be a letter
351  }
352 
353  /* Get first 30 minute north/south letter, A-Q */
354  int[] ns_str = new int[3];
355  ns_str[0] = letter - LETTER_A_OFFSET;
356  letter = GARSString[++index];
357  if (!Character.isLetter(letter)) {
358  ll = new double[1];
359  ll[0] = -360;
360  return ll; // The latitude band must be a letter
361  }
362  /* Get second 30 minute north/south letter, A-Z */
363  ns_str[1] = letter - LETTER_A_OFFSET;
364 
365  char _15_minute_value = 0;
366  char _5_minute_value = 0;
367  if (index + 1 < gars_length) {
368  /* Get 15 minute quadrant value, 1-4 */
369  _15_minute_value = GARSString[++index];
370  if (!isDigit(_15_minute_value) || _15_minute_value < _1 || _15_minute_value > _4) {
371  ll = new double[1];
372  ll[0] = -360;
373  return ll;
374  } else {
375  if (index + 1 < gars_length) {
376  /* Get 5 minute quadrant value, 1-9 */
377  _5_minute_value = GARSString[++index];
378  if (!isDigit(_5_minute_value) || _5_minute_value < _1 || _5_minute_value > _9) {
379  ll = new double[1];
380  ll[0] = -360;
381  return ll;
382  }
383  }
384  }
385  }//
386 
387  double longitude = (((ew_value - 1.0) / 2.0) - 180.0);
388  /* Letter I and O are invalid */
389  if (ns_str[0] >= LETTER_O) {
390  ns_str[0]--;
391  }
392  if (ns_str[0] >= LETTER_I) {
393  ns_str[0]--;
394  }
395 
396  if (ns_str[1] >= LETTER_O) {
397  ns_str[1]--;
398  }
399  if (ns_str[1] >= LETTER_I) {
400  ns_str[1]--;
401  }
402 
403  double latitude = ((-90.0 + (ns_str[0] * 12.0)) + (ns_str[1] / 2.0));
404 
405  double lat_minutes = 0.0, lon_minutes = 0.0;
406 
407  //Strings in switch not allowed in Java 6
408  if (Character.toString(_15_minute_value).equals("1")) {
409  lat_minutes = 15.0;
410  } else if (Character.toString(_15_minute_value).equals("4")) {
411  lon_minutes = 15.0;
412  } else if (Character.toString(_15_minute_value).equals("2")) {
413  lat_minutes = 15.0;
414  lon_minutes = 15.0;
415  }
416 
417  if (Character.toString(_5_minute_value).equals("4")) {
418  lat_minutes += 5.0;
419  } else if (Character.toString(_5_minute_value).equals("1")) {
420  lat_minutes += 10.0;
421  } else if (Character.toString(_5_minute_value).equals("8")) {
422  lon_minutes += 5.0;
423  } else if (Character.toString(_5_minute_value).equals("5")) {
424  lon_minutes += 5.0;
425  lat_minutes += 5.0;
426  } else if (Character.toString(_5_minute_value).equals("2")) {
427  lon_minutes += 5.0;
428  lat_minutes += 10.0;
429  } else if (Character.toString(_5_minute_value).equals("9")) {
430  lon_minutes += 10.0;
431  } else if (Character.toString(_5_minute_value).equals("6")) {
432  lon_minutes += 10.0;
433  lat_minutes += 5.0;
434  } else if (Character.toString(_5_minute_value).equals("3")) {
435  lon_minutes += 10.0;
436  lat_minutes += 10.0;
437  }
438 
439  // Store lower left coordinates
440  ll[0] = latitude + lat_minutes / MIN_PER_DEG;
441  ll[1] = longitude + lon_minutes / MIN_PER_DEG;;
442 
443  /* Add these values to force the reference point to be the upper right corner of the box */
444  if (_5_minute_value != 0) {
445  lat_minutes += 5.0;
446  lon_minutes += 5.0;
447  } else if (_15_minute_value != 0) {
448  lat_minutes += 15.0;
449  lon_minutes += 15.0;
450  } else {
451  lat_minutes += 30.0;
452  lon_minutes += 30.0;
453  }
454  latitude += lat_minutes / MIN_PER_DEG;
455  longitude += lon_minutes / MIN_PER_DEG;
456  ll[2] = latitude;
457  ll[3] = longitude;
458  return ll;
459 
460  }//getCornerCoordsArray

Referenced by GARStoLL.getCornerJSONCoords(), GARStoLL.getKMLLine(), and GARStoLL.getKMLPolygon().

◆ getCornerJSONCoords()

static String getCornerJSONCoords ( String  GARS)
static

Convert a GARS string to JSON representation of the corner coordinates.

The JSON is will always return a status key with either "error" or "success".
If the conversion was successful then latitude and longitude keys are returned with decimal degrees values for the lower left and upper right corners of the GARS tile.
The corner coordinates are referenced by the keys "lowerleft" and "upperright" and are an object containing a "latitude" and "longitude" coordinate.

A typical JSON string looks like the following:
{
"status": "success",
"lowerleft": { "latitude":-33.4167, "longitude":-70.4167 },
"upperright": { "latitude":-33.3336, "longitude":-70.3333 }
}

Parameters
GARS
Returns
JSON string
484  {
485  double[] ll = getCornerCoordsArray(GARS);
486  if (ll.length < 4) {
487  return "{\"status\":\"error\"}";
488  }
489  StringBuilder json = new StringBuilder();
490  json.append("{\"status\":\"success\",");
491  json.append("\"lowerleft\":{\"latitude\":").append(ll[0]).append(",\"longitude\":").append(ll[1]).append("},");
492  json.append("\"upperright\":{\"latitude\":").append(ll[2]).append(",\"longitude\":").append(ll[3]).append("}");
493  json.append("}");
494 
495  return json.toString();
496 
497  }//getCornerJSONCoords
static double[] getCornerCoordsArray(String GARS)
Convert a GARS string to double array containing latitude and longitude coordinates of the lower left...
Definition: GARStoLL.java:294

References GARStoLL.getCornerCoordsArray().

◆ getKMLLine()

static String getKMLLine ( String  GARS,
String  kmlColor,
double  kmlWidth 
)
static

Convert a GARS String to a KML Placemark fragment representing the GARS tile as a line.

If the GARS string is invalid then an empty string is returned.

kmlColor is a string in the format of aabbggrr, where aa=alpha (00 to ff); bb=blue (00 to ff); gg=green (00 to ff); rr=red (00 to ff)
Example: blue color with 50 percent opacity = 7fff0000

kmlWidth is an integer representing the line width.

Parameters
GARS
kmlColorthe color of the line
kmlWidththe width of the line
Returns
KML Placemark fragment
514  {
515  StringBuilder kml = new StringBuilder();
516  double[] ll = getCornerCoordsArray(GARS);
517  if (ll.length < 4) {
518  return "";
519  }
520  kml.append("<Placemark> \n"
521  + " <LineString>\n"
522  + " <coordinates>\n");
523  kml.append(ll[1]).append(",").append(ll[0]).append(",0.0\n");
524  kml.append(ll[1]).append(",").append(ll[2]).append(",0.0\n");
525  kml.append(ll[3]).append(",").append(ll[2]).append(",0.0\n");
526  kml.append(ll[3]).append(",").append(ll[0]).append(",0.0\n");
527  kml.append(ll[1]).append(",").append(ll[0]).append(",0.0\n"
528  + " </coordinates>\n"
529  + " </LineString>\n"
530  + " <Style>\n"
531  + " <LineStyle>\n"
532  + " <color>#");
533  kml.append(kmlColor);
534  kml.append("</color>\n"
535  + " <width>");
536  kml.append(kmlWidth);
537  kml.append("</width>\n"
538  + " </LineStyle> \n"
539  + " </Style>\n"
540  + "</Placemark>");
541  return kml.toString();
542  }//getKMLLine

References GARStoLL.getCornerCoordsArray().

◆ getKMLPoint()

static String getKMLPoint ( String  GARS,
String  lblColor,
double  lblSize 
)
static

Convert a GARS String to a KML Placemark fragment depicting the GARS string as a label in the center of the GARS tile.

KML colors are a string in the format of aabbggrr, where aa=alpha (00 to ff); bb=blue (00 to ff); gg=green (00 to ff); rr=red (00 to ff)
Example: blue color with 50 percent opacity = 7fff0000

Parameters
GARS
lblColorthe color of the text
lblSizethe size of the text (as a ratio to the normal size of 1.0)
Returns
KML Placemark fragment
613  {
614  double[] ll = getCenterCoordsArray(GARS);
615  if (ll.length != 2) {
616  return "";
617  }
618  StringBuilder latlon = new StringBuilder();
619  latlon.append(ll[1]).append(",").append(ll[0]);
620 
621  StringBuilder kml = new StringBuilder();
622  kml.append(" <Placemark>\n"
623  + " <name>" + GARS + "</name>\n"
624  + " <Style>\n"
625  + " <IconStyle>\n"
626  + " <scale>0</scale>\n"
627  + " </IconStyle>\n"
628  + " <LabelStyle>\n"
629  + " <color>" + lblColor + "</color>\n"
630  + " <scale>" + lblSize + "</scale>"
631  + " </LabelStyle>"
632  + " </Style>\n"
633  + " <Point>\n"
634  + "\n"
635  + " <coordinates>" + latlon + ",0</coordinates>\n"
636  + " </Point>\n"
637  + " </Placemark>");
638  return kml.toString();
639  }//getKMLPoint

References GARStoLL.getCenterCoordsArray().

◆ getKMLPolygon()

static String getKMLPolygon ( String  GARS,
String  kmlColor,
String  kmlFillColor,
double  kmlWidth 
)
static

Convert a GARS String to a KML Placemark fragment representing the GARS tile as a filled polygon.

If the GARS string is invalid then an empty string is returned.

KML colors are a string in the format of aabbggrr, where aa=alpha (00 to ff); bb=blue (00 to ff); gg=green (00 to ff); rr=red (00 to ff)
Example: blue color with 50 percent opacity = 7fff0000

kmlWidth is an integer representing the line width.

Parameters
GARS
kmlColorthe color of the line
kmlFillColorthe color of the polygon's fill
kmlWidththe width of the line
Returns
KML Placemark fragment
560  {
561  StringBuilder kml = new StringBuilder();
562  double[] ll = getCornerCoordsArray(GARS);
563  if (ll.length < 4) {
564  return "";
565  }
566  kml.append("<Placemark> \n"
567  + "<Polygon>\n"
568  + "<tessellate>1</tessellate>\n"
569  + "<outerBoundaryIs>\n"
570  + "<LinearRing>\n"
571  + " <coordinates>\n");
572  kml.append(ll[1]).append(",").append(ll[0]).append(",0.0\n");
573  kml.append(ll[1]).append(",").append(ll[2]).append(",0.0\n");
574  kml.append(ll[3]).append(",").append(ll[2]).append(",0.0\n");
575  kml.append(ll[3]).append(",").append(ll[0]).append(",0.0\n");
576  kml.append(ll[1]).append(",").append(ll[0]).append(",0.0\n"
577  + " </coordinates>\n"
578  + "</LinearRing>\n"
579  + "</outerBoundaryIs>\n"
580  + "</Polygon>\n"
581  + " <Style>\n"
582  + " <LineStyle>\n"
583  + " <color>#");
584  kml.append(kmlColor);
585  kml.append("</color>\n"
586  + " <width>");
587  kml.append(kmlWidth);
588  kml.append("</width>\n"
589  + " </LineStyle> \n"
590  + " <PolyStyle>\n"
591  + " <color>#");
592  kml.append(kmlFillColor);
593  kml.append("</color>\n"
594  + " </PolyStyle> \n"
595  + " </Style>\n"
596  + "</Placemark>");
597  return kml.toString();
598  }//getKMLLine

References GARStoLL.getCornerCoordsArray().