@@ -179,8 +179,6 @@ def isValid(code):
179
179
return True
180
180
181
181
182
-
183
-
184
182
def isShort (code ):
185
183
"""
186
184
Determines if a code is a valid short code.
@@ -198,8 +196,6 @@ def isShort(code):
198
196
return False
199
197
200
198
201
-
202
-
203
199
def isFull (code ):
204
200
"""
205
201
Determines if a code is a valid full Open Location Code.
@@ -228,10 +224,7 @@ def isFull(code):
228
224
return True
229
225
230
226
231
-
232
-
233
227
def encode (latitude , longitude , codeLength = PAIR_CODE_LENGTH_ ):
234
-
235
228
"""
236
229
Encode a location into an Open Location Code.
237
230
Produces a code of the specified length, or the default length if no length
@@ -248,7 +241,6 @@ def encode(latitude, longitude, codeLength=PAIR_CODE_LENGTH_):
248
241
codeLength: The number of significant digits in the output code, not
249
242
including any separator characters.
250
243
"""
251
-
252
244
if codeLength < 2 or (codeLength < PAIR_CODE_LENGTH_ and
253
245
codeLength % 2 == 1 ):
254
246
raise ValueError ('Invalid Open Location Code length - ' +
@@ -305,8 +297,6 @@ def encode(latitude, longitude, codeLength=PAIR_CODE_LENGTH_):
305
297
codeLength ) + SEPARATOR_
306
298
307
299
308
-
309
-
310
300
def decode (code ):
311
301
"""
312
302
Decodes an Open Location Code into the location coordinates.
@@ -318,7 +308,6 @@ def decode(code):
318
308
A CodeArea object that provides the latitude and longitude of two of the
319
309
corners of the area, the center, and the length of the original code.
320
310
"""
321
-
322
311
if not isFull (code ):
323
312
raise ValueError (
324
313
'Passed Open Location Code is not a valid full code - ' + str (code ))
@@ -383,8 +372,6 @@ def decode(code):
383
372
384
373
385
374
386
-
387
-
388
375
def recoverNearest (code , referenceLatitude , referenceLongitude ):
389
376
"""
390
377
Recover the nearest matching code to a specified location.
@@ -455,8 +442,6 @@ def recoverNearest(code, referenceLatitude, referenceLongitude):
455
442
codeArea .codeLength )
456
443
457
444
458
-
459
-
460
445
def shorten (code , latitude , longitude ):
461
446
"""
462
447
Remove characters from the start of an OLC code.
@@ -505,8 +490,6 @@ def shorten(code, latitude, longitude):
505
490
return code
506
491
507
492
508
-
509
-
510
493
def clipLatitude (latitude ):
511
494
"""
512
495
Clip a latitude into the range -90 to 90.
@@ -516,8 +499,6 @@ def clipLatitude(latitude):
516
499
return min (90 , max (- 90 , latitude ))
517
500
518
501
519
-
520
-
521
502
def computeLatitudePrecision (codeLength ):
522
503
"""
523
504
Compute the latitude precision value for a given code length. Lengths <=
@@ -530,8 +511,6 @@ def computeLatitudePrecision(codeLength):
530
511
return pow (20 , - 3 ) / pow (GRID_ROWS_ , codeLength - 10 )
531
512
532
513
533
-
534
-
535
514
def normalizeLongitude (longitude ):
536
515
"""
537
516
Normalize a longitude into the range -180 to 180, not including 180.
@@ -545,8 +524,6 @@ def normalizeLongitude(longitude):
545
524
return longitude
546
525
547
526
548
-
549
-
550
527
class CodeArea (object ):
551
528
"""
552
529
Coordinates of a decoded Open Location Code.
0 commit comments