geo-coordinates-parser 1.5.5 → 1.5.8

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -71,9 +71,10 @@ Formats used for testing can be be accessed with:
71
71
  convert.formats
72
72
  ```
73
73
 
74
- **<span style="color:red">Please add coordinate formats that throw an error in the Github Issues.</span>**
74
+ **Please add coordinate formats that throw an error in the Github Issues.**
75
75
 
76
- **<span style="color:red">Note that formats like 24.56S 26.48E are treated as degrees and minutes! And 24.0, 26.0 is treated as an error. If you don't want this behaviour you need to catch these cases with your own code before you use convert.</span>**
76
+ **CAUTION!!!**
77
+ **Coordinates like '24.56S 26.48E' are treated as degrees and minutes and '24, 26' or '24.0, 26.0' will throw an error. If you don't want this behaviour you need to catch these cases with your own code before you use convert.* *
77
78
 
78
79
  ### Want to use it in the browser?
79
80
  Add ```<script src="https://cdn.jsdelivr.net/npm/geo-coordinates-parser/bundle/geocoordsparser.js"></script>```
package/converter.js CHANGED
@@ -1,4 +1,7 @@
1
1
  //function for converting coordinates from a string to decimal and verbatim
2
+ //this is just a comment
3
+
4
+ const { dd_re, dms_periods, dms_abbr, coords_other } = require('./regex.js')
2
5
 
3
6
  const toCoordinateFormat = require('./toCoordinateFormat.js')
4
7
 
@@ -15,7 +18,7 @@ function converter(coordsString, decimalPlaces) {
15
18
  decimalPlaces = 5
16
19
  }
17
20
 
18
- coordsString = coordsString.replace(/\s\s+/g, ' ').trim(); //just to tidy up whitespaces
21
+ coordsString = coordsString.replace(/\s+/g, ' ').trim(); //just to tidy up whitespaces
19
22
 
20
23
  var ddLat = null;
21
24
  var ddLng = null;
@@ -43,11 +46,11 @@ function converter(coordsString, decimalPlaces) {
43
46
 
44
47
  //some more validation: no zero coords or degrees only
45
48
  if (Number(Math.round(ddLat)) == Number(ddLat)) {
46
- throw new Error('degree only coordinate provided')
49
+ throw new Error('integer only coordinate provided')
47
50
  }
48
51
 
49
52
  if (Number(Math.round(ddLng)) == Number(ddLng)) {
50
- throw new Error('degree only coordinate provided')
53
+ throw new Error('integer only coordinate provided')
51
54
  }
52
55
 
53
56
  //get directions
@@ -78,7 +81,7 @@ function converter(coordsString, decimalPlaces) {
78
81
  }
79
82
 
80
83
  if (match[6]){
81
- ddLat += match[6]/3600;
84
+ ddLat += match[6].replace(',', '.')/3600;
82
85
  }
83
86
 
84
87
  if (parseInt(match[2]) < 0) {
@@ -92,7 +95,7 @@ function converter(coordsString, decimalPlaces) {
92
95
  }
93
96
 
94
97
  if (match[13]) {
95
- ddLng += match[13]/3600;
98
+ ddLng += match[13].replace(',', '.')/3600;
96
99
  }
97
100
 
98
101
  if (parseInt(match[9]) < 0) {
@@ -107,19 +110,10 @@ function converter(coordsString, decimalPlaces) {
107
110
  else if (match[7]) {
108
111
  latdir = match[7];
109
112
  lngdir = match[14];
110
- }
111
- else { //we have to catch an edge case where we have no direction indicators
112
- throw new Error("invalid DMS coordinates format")
113
- }
114
-
115
- //we have to catch another edge case here, same or missing direction indicators
116
- if(!latdir || !lngdir) {
117
- throw new Error("invalid DMS coordinates format")
118
- }
119
-
113
+ }
120
114
  }
121
115
  else {
122
- throw new Error("invalid DMS coordinates format")
116
+ throw new Error("invalid DMS coordinates format")
123
117
  }
124
118
  }
125
119
  else if (dms_abbr.test(coordsString)) {
@@ -130,16 +124,10 @@ function converter(coordsString, decimalPlaces) {
130
124
  ddLat = Math.abs(parseInt(match[2]));
131
125
  if (match[4]) {
132
126
  ddLat += match[4]/60;
133
- if(!match[3]) {
134
- match[3] = ' ';
135
- }
136
127
  }
137
128
 
138
129
  if (match[6]) {
139
130
  ddLat += match[6]/3600;
140
- if(!match[5]) {
141
- match[5] = ' ';
142
- }
143
131
  }
144
132
 
145
133
  if (parseInt(match[2]) < 0) {
@@ -150,16 +138,10 @@ function converter(coordsString, decimalPlaces) {
150
138
 
151
139
  if (match[12]) {
152
140
  ddLng += match[12]/60;
153
- if(!match[11]) {
154
- match[11] = ' ';
155
- }
156
141
  }
157
142
 
158
143
  if (match[14]) {
159
144
  ddLng += match[14]/3600;
160
- if(!match[13]) {
161
- match[13] = ' ';
162
- }
163
145
  }
164
146
 
165
147
  if (parseInt(match[10]) < 0) {
@@ -188,16 +170,10 @@ function converter(coordsString, decimalPlaces) {
188
170
  ddLat = Math.abs(parseInt(match[2]));
189
171
  if (match[4]){
190
172
  ddLat += match[4]/60;
191
- if(!match[3]) {
192
- match[3] = ' ';
193
- }
194
173
  }
195
174
 
196
175
  if (match[6]) {
197
176
  ddLat += match[6]/3600;
198
- if(!match[5]) {
199
- match[5] = ' ';
200
- }
201
177
  }
202
178
 
203
179
  if (parseInt(match[2]) < 0) {
@@ -207,16 +183,10 @@ function converter(coordsString, decimalPlaces) {
207
183
  ddLng = Math.abs(parseInt(match[10]));
208
184
  if (match[12]) {
209
185
  ddLng += match[12]/60;
210
- if(!match[11]) {
211
- match[11] = ' ';
212
- }
213
186
  }
214
187
 
215
188
  if (match[14]) {
216
189
  ddLng += match[14]/3600;
217
- if(!match[13]) {
218
- match[13] = ' ';
219
- }
220
190
  }
221
191
 
222
192
  if (parseInt(match[10]) < 0) {
@@ -230,25 +200,37 @@ function converter(coordsString, decimalPlaces) {
230
200
  latdir = match[8];
231
201
  lngdir = match[16];
232
202
  }
233
-
203
+
234
204
  }
235
205
  else {
236
206
  throw new Error("invalid coordinates format")
237
207
  }
238
208
  }
239
209
 
240
- //check longitude value - it can be wrong!
241
- if (Math.abs(ddLng) >= 180) {
242
- throw new Error("invalid longitude value")
243
- }
244
-
245
- //just to be safe check latitude also...
246
- if (Math.abs(ddLat) >= 90) {
247
- throw new Error("invalid latitude value")
248
- }
249
-
250
210
  if (matchSuccess){
251
-
211
+
212
+ //more validation....
213
+
214
+ //check longitude value - it can be wrong!
215
+ if (Math.abs(ddLng) >= 180) {
216
+ throw new Error("invalid longitude value")
217
+ }
218
+
219
+ //just to be safe check latitude also...
220
+ if (Math.abs(ddLat) >= 90) {
221
+ throw new Error("invalid latitude value")
222
+ }
223
+
224
+ //if we have one direction we must have the other
225
+ if((latdir || lngdir) && (!latdir || !lngdir)) {
226
+ throw new Error("invalid coordinates format")
227
+ }
228
+
229
+ //the directions can't be the same
230
+ if(latdir && latdir == lngdir) {
231
+ throw new Error("invalid coordinates format")
232
+ }
233
+
252
234
  //make sure the signs and cardinal directions match
253
235
  var patt = /S|SOUTH/i;
254
236
  if (patt.test(latdir)) {
@@ -264,7 +246,6 @@ function converter(coordsString, decimalPlaces) {
264
246
  }
265
247
  }
266
248
 
267
-
268
249
  //we need to get the verbatim coords from the string
269
250
  //we can't split down the middle because if there are decimals they may have different numbers on each side
270
251
  //so we need to find the separating character, or if none, use the match values to split down the middle
@@ -317,7 +298,32 @@ function converter(coordsString, decimalPlaces) {
317
298
  }
318
299
 
319
300
  }
301
+
302
+ //validation again...
303
+
304
+ //we only allow zeros after the period if its DM
305
+ const splitLat = verbatimLat.split('.')
306
+ if(splitLat.length == 2) {
307
+ if(splitLat[1] == 0 && splitLat[1].length != 2){
308
+ throw new Error('invalid coordinates format')
309
+ }
310
+ }
311
+
312
+ const splitLon = verbatimLng.split('.')
313
+ if(splitLon.length == 2) {
314
+ if(splitLon[1] == 0 && splitLon[1].length != 2){
315
+ throw new Error('invalid coordinates format')
316
+ }
317
+ }
318
+
319
+ //no integer coords allowed
320
+ //validation -- no integer coords
321
+ if(/^\d+$/.test(verbatimLat) || /^\d+$/.test(verbatimLng)) {
322
+ throw new Error('degree only coordinate/s provided')
323
+ }
320
324
 
325
+
326
+ //some tidying up...
321
327
  if(isNaN(ddLat) && ddLat.includes(',')) {
322
328
  ddLat = ddLat.replace(',', '.')
323
329
  }
@@ -356,7 +362,8 @@ function checkMatch(match) { //test if the matched groups arrays are 'balanced'.
356
362
  }
357
363
 
358
364
  //first remove the empty values from the array
359
- var filteredMatch = match.filter(x=>x);
365
+ //var filteredMatch = match.filter(x=>x);
366
+ var filteredMatch = [...match]
360
367
 
361
368
  //we need to shift the array because it contains the whole coordinates string in the first item
362
369
  filteredMatch.shift();
@@ -367,7 +374,7 @@ function checkMatch(match) { //test if the matched groups arrays are 'balanced'.
367
374
  }
368
375
 
369
376
  //regex for testing corresponding values match
370
- var numerictest = /^[-+]?\d+([\.,]{1}\d+)?$/; //for testing numeric values
377
+ var numerictest = /^[-+]?\d+([\.,]\d+)?$/; //for testing numeric values
371
378
  var stringtest = /[eastsouthnorthwest]+/i; //for testing string values (north, south, etc)
372
379
 
373
380
 
@@ -375,7 +382,16 @@ function checkMatch(match) { //test if the matched groups arrays are 'balanced'.
375
382
  for (var i = 0; i < halflen; i++) {
376
383
  const leftside = filteredMatch[i]
377
384
  const rightside = filteredMatch[i + halflen]
378
- if ((numerictest.test(leftside) && numerictest.test(rightside)) || (stringtest.test(leftside) && stringtest.test(rightside)) || leftside == rightside) {
385
+ const bothAreNumbers = numerictest.test(leftside) && numerictest.test(rightside)
386
+ const bothAreStrings = stringtest.test(leftside) && stringtest.test(rightside)
387
+ const valuesAreEqual = leftside == rightside
388
+ if (leftside == undefined && rightside == undefined) { //we have to handle undefined because regex converts it to string 'undefined'!!
389
+ continue
390
+ }
391
+ else if (leftside == undefined || rightside == undefined) { //no we need to handle the case where one is and the other not...
392
+ return false
393
+ }
394
+ else if (bothAreNumbers || bothAreStrings || valuesAreEqual) {
379
395
  continue;
380
396
  }
381
397
  else {
@@ -416,19 +432,6 @@ function coordsCloseEnough(coordsToTest) {
416
432
  }
417
433
  }
418
434
 
419
- //Coordinates pattern matching regex
420
-
421
- //decimal degrees
422
- var dd_re = /(NORTH|SOUTH|[NS])?[\s]*([+-]?[0-8]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(NORTH|SOUTH|[NS])?[\s]*[,/;]?[\s]*(EAST|WEST|[EW])?[\s]*([+-]?[0-1]?[0-9]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(EAST|WEST|[EW])?/i;
423
-
424
- //degrees minutes seconds with '.' as separator - gives array with 15 values
425
- var dms_periods = /(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)?\s*((?:[0-5]?[0-9])(?:\.\d{1,3})?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)?\s*((?:[0-5]?[0-9])(?:\.\d{1,3})?)?\s*(EAST|WEST|[EW])?/i;
426
-
427
- //degrees minutes seconds with words 'degrees, minutes, seconds' as separators (needed because the s of seconds messes with the S of SOUTH) - gives array of 17 values
428
- var dms_abbr = /(NORTH|SOUTH|[NS])?[\ \t]*([+-]?[0-8]?[0-9])[\ \t]*(D(?:EG)?(?:REES)?)[\ \t]*([0-5]?[0-9])[\ \t]*(M(?:IN)?(?:UTES)?)[\ \t]*((?:[0-5]?[0-9])(?:\.\d{1,3})?)?(S(?:EC)?(?:ONDS)?)?[\ \t]*(NORTH|SOUTH|[NS])?(?:[\ \t]*[,/;][\ \t]*|[\ \t]*)(EAST|WEST|[EW])?[\ \t]*([+-]?[0-1]?[0-9]?[0-9])[\ \t]*(D(?:EG)?(?:REES)?)[\ \t]*([0-5]?[0-9])[\ \t]*(M(?:IN)?(?:UTES)?)[\ \t]*((?:[0-5]?[0-9])(?:\.\d{1,3})?)?(S(?:EC)?(?:ONDS)?)[\ \t]*(EAST|WEST|[EW])?/i;
429
-
430
- //everything else - gives array of 17 values
431
- var coords_other = /(NORTH|SOUTH|[NS])?[\ \t]*([+-]?[0-8]?[0-9])[\ \t]*([•º°\.:]|D(?:EG)?(?:REES)?)?[\ \t]*,?([0-5]?[0-9](?:\.\d{1,})?)?[\ \t]*(['′´’\.:]|M(?:IN)?(?:UTES)?)?[\ \t]*,?((?:[0-5]?[0-9])(?:\.\d{1,3})?)?[\ \t]*(''|′′|’’|´´|["″”\.])?[\ \t]*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?[\ \t]*([+-]?[0-1]?[0-9]?[0-9])[\ \t]*([•º°\.:]|D(?:EG)?(?:REES)?)?[\ \t]*,?([0-5]?[0-9](?:\.\d{1,})?)?[\ \t]*(['′´’\.:]|M(?:IN)?(?:UTES)?)?[\ \t]*,?((?:[0-5]?[0-9])(?:\.\d{1,3})?)?[\ \t]*(''|′′|´´|’’|["″”\.])?[\ \t]*(EAST|WEST|[EW])?/i;
432
435
 
433
436
  const to = Object.freeze({
434
437
  DMS: 'DMS',
package/failFormats.js CHANGED
@@ -1,6 +1,13 @@
1
1
  //TODO These formats should throw...
2
2
 
3
3
  const failingFormats = [
4
+ '10,10',
5
+ '46,8',
6
+ '12.12323, 123',
7
+ '24.0, 26.0',
8
+ '27.0 23.0', //same as above but different values
9
+ '10.00000S 10.000000E', //integer values only
10
+ '00.00 01.00', //DM, but no directions
4
11
  '50°4\'17.698"south, 24.34532', //different formats on each side
5
12
  '90°4\'17.698"south, 23°4\'17.698"east', //latitude out of bounds
6
13
  '89°4\'17.698"south, 183°4\'17.698"east', //longitude out of bounds
@@ -11,6 +18,7 @@ const failingFormats = [
11
18
  'S 27.45.34 S 23.23.23', //invalid direction on right side
12
19
  'S 90°4\'17.698" S 23°4\'17.698"',
13
20
  '27.45.34 S S 23.23.23', //invalid direction on right side
21
+ '27.45.34 23.23.23 E' //no dir on one side
14
22
  ]
15
23
 
16
24
  module.exports = failingFormats
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geo-coordinates-parser",
3
- "version": "1.5.5",
3
+ "version": "1.5.8",
4
4
  "description": "A Javascript function for reading a variety of coordinate formats and converting to decimal numbers. Builds on other efforts by returning the verbatim coordinates and the decimal coordinates all in one object.",
5
5
  "main": "merge.js",
6
6
  "scripts": {
package/regex.js ADDED
@@ -0,0 +1,20 @@
1
+ //Coordinates pattern matching regex
2
+
3
+ //decimal degrees
4
+ var dd_re = /(NORTH|SOUTH|[NS])?[\s]*([+-]?[0-8]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(NORTH|SOUTH|[NS])?[\s]*[,/;]?[\s]*(EAST|WEST|[EW])?[\s]*([+-]?[0-1]?[0-9]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(EAST|WEST|[EW])?/i;
5
+
6
+ //degrees minutes seconds with '.' as separator - gives array with 15 values
7
+ var dms_periods = /(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(EAST|WEST|[EW])?/i;
8
+
9
+ //degrees minutes seconds with words 'degrees, minutes, seconds' as separators (needed because the s of seconds messes with the S of SOUTH) - gives array of 17 values
10
+ var dms_abbr = /(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)\s*(EAST|WEST|[EW])?/i;
11
+
12
+ //everything else - gives array of 17 values
13
+ var coords_other = /(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|’’|´´|["″”\.])?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|´´|’’|["″”\.])?\s*(EAST|WEST|[EW])?/i;
14
+
15
+ module.exports = {
16
+ dd_re,
17
+ dms_periods,
18
+ dms_abbr,
19
+ coords_other
20
+ }
package/testFormats.json CHANGED
@@ -132,6 +132,13 @@
132
132
  "decimalLatitude": 40.1230555555,
133
133
  "decimalLongitude": -74.12305555555555
134
134
  },
135
+ {
136
+ "verbatimCoordinates": "40°7’23\"S 74°7’23\"E",
137
+ "verbatimLatitude": "40°7’23\"S",
138
+ "verbatimLongitude": "74°7’23\"E",
139
+ "decimalLatitude": -40.1230555555,
140
+ "decimalLongitude": 74.12305555555555
141
+ },
135
142
  {
136
143
  "verbatimCoordinates": "40°7’23\" -74°7’23\"",
137
144
  "verbatimLatitude": "40°7’23\"",
@@ -293,6 +300,27 @@
293
300
  "decimalLatitude": -27.2625,
294
301
  "decimalLongitude": 18.548055
295
302
  },
303
+ {
304
+ "verbatimCoordinates": "-27.15.45 18.32.53",
305
+ "verbatimLatitude": "-27.15.45",
306
+ "verbatimLongitude": "18.32.53",
307
+ "decimalLatitude": -27.2625,
308
+ "decimalLongitude": 18.548055
309
+ },
310
+ {
311
+ "verbatimCoordinates": "27.15.45.2S 18.32.53.4E",
312
+ "verbatimLatitude": "27.15.45.2S",
313
+ "verbatimLongitude": "18.32.53.4E",
314
+ "decimalLatitude": -27.262556,
315
+ "decimalLongitude": 18.548167
316
+ },
317
+ {
318
+ "verbatimCoordinates": "27.15.45,2S 18.32.53,4E",
319
+ "verbatimLatitude": "27.15.45,2S",
320
+ "verbatimLongitude": "18.32.53,4E",
321
+ "decimalLatitude": -27.262556,
322
+ "decimalLongitude": 18.548167
323
+ },
296
324
  {
297
325
  "verbatimCoordinates": "S23.43563 ° E22.45634 °",
298
326
  "verbatimLatitude": "S23.43563 °",
@@ -313,5 +341,12 @@
313
341
  "verbatimLongitude": "23.23.23 E",
314
342
  "decimalLatitude": -27.759444,
315
343
  "decimalLongitude": 23.38972222
344
+ },
345
+ {
346
+ "verbatimCoordinates": "S 27.45.34 E 23.23.23",
347
+ "verbatimLatitude": "S 27.45.34",
348
+ "verbatimLongitude": "E 23.23.23",
349
+ "decimalLatitude": -27.759444,
350
+ "decimalLongitude": 23.38972222
316
351
  }
317
352
  ]
package/testIndividual.js CHANGED
@@ -1,5 +1,6 @@
1
1
  const convert = require('./converter')
2
- const test = 'S 27.45.34 S 23.23.23'
2
+ const test = '10,11'
3
+ //const test = '00.00, 01.00'
3
4
 
4
5
  try{
5
6
  let converted = convert(test)
package/testformats.js CHANGED
@@ -103,6 +103,13 @@ var coordsParserFormats = [
103
103
  decimalLatitude: 40.1230555555,
104
104
  decimalLongitude: -74.12305555555555
105
105
  },
106
+ {
107
+ verbatimCoordinates: '40°7’23"S 74°7’23"E',
108
+ verbatimLatitude: '40°7’23"S',
109
+ verbatimLongitude: '74°7’23"E',
110
+ decimalLatitude: -40.1230555555,
111
+ decimalLongitude: 74.12305555555555
112
+ },
106
113
  {
107
114
  verbatimCoordinates: '40°7’23" -74°7’23"',
108
115
  verbatimLatitude: '40°7’23"',
@@ -237,6 +244,27 @@ var coordsRegexFormats = [
237
244
 
238
245
  var otherFormats = [
239
246
  // additional formats we've encountered
247
+ {
248
+ verbatimCoordinates: '10.432342S 10.6345345E', //this is read as degrees and minutes
249
+ verbatimLatitude: '10.432342S',
250
+ verbatimLongitude: '10.6345345E',
251
+ decimalLatitude: -10.432342,
252
+ decimalLongitude: 10.6345345
253
+ },
254
+ {
255
+ verbatimCoordinates: '10.00S 10.00E', //this is read as degrees and minutes
256
+ verbatimLatitude: '10.00S',
257
+ verbatimLongitude: '10.00E',
258
+ decimalLatitude: -10.00000,
259
+ decimalLongitude: 10.00000
260
+ },
261
+ {
262
+ verbatimCoordinates: '00.00S 01.00E', //this is read as degrees and minutes
263
+ verbatimLatitude: '00.00S',
264
+ verbatimLongitude: '01.00E',
265
+ decimalLatitude: 0.00000,
266
+ decimalLongitude: 1.00000
267
+ },
240
268
  {
241
269
  verbatimCoordinates: '18.24S 22.45E', //this is read as degrees and minutes
242
270
  verbatimLatitude: '18.24S',
@@ -272,6 +300,27 @@ var otherFormats = [
272
300
  verbatimLongitude: '18.32.53E',
273
301
  decimalLatitude: -27.2625,
274
302
  decimalLongitude: 18.548055
303
+ },
304
+ {
305
+ verbatimCoordinates: '-27.15.45 18.32.53',
306
+ verbatimLatitude: '-27.15.45',
307
+ verbatimLongitude: '18.32.53',
308
+ decimalLatitude: -27.2625,
309
+ decimalLongitude: 18.548055
310
+ },
311
+ {
312
+ verbatimCoordinates: '27.15.45.2S 18.32.53.4E',
313
+ verbatimLatitude: '27.15.45.2S',
314
+ verbatimLongitude: '18.32.53.4E',
315
+ decimalLatitude: -27.262556,
316
+ decimalLongitude: 18.548167
317
+ },
318
+ {
319
+ verbatimCoordinates: '27.15.45,2S 18.32.53,4E',
320
+ verbatimLatitude: '27.15.45,2S',
321
+ verbatimLongitude: '18.32.53,4E',
322
+ decimalLatitude: -27.262556,
323
+ decimalLongitude: 18.548167
275
324
  },
276
325
  {
277
326
  verbatimCoordinates: 'S23.43563 ° E22.45634 °', //decimals with spaces before the symbol!!