Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5c14fe8

Browse files
authored
Removing extra newlines
This PR removes newlines from the file, so that your PR to google/open-location-code can be accepted according to: google#418
1 parent 4f0a7b1 commit 5c14fe8

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

python/openlocationcode/openlocationcode.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,6 @@ def isValid(code):
179179
return True
180180

181181

182-
183-
184182
def isShort(code):
185183
"""
186184
Determines if a code is a valid short code.
@@ -198,8 +196,6 @@ def isShort(code):
198196
return False
199197

200198

201-
202-
203199
def isFull(code):
204200
"""
205201
Determines if a code is a valid full Open Location Code.
@@ -228,10 +224,7 @@ def isFull(code):
228224
return True
229225

230226

231-
232-
233227
def encode(latitude, longitude, codeLength=PAIR_CODE_LENGTH_):
234-
235228
"""
236229
Encode a location into an Open Location Code.
237230
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_):
248241
codeLength: The number of significant digits in the output code, not
249242
including any separator characters.
250243
"""
251-
252244
if codeLength < 2 or (codeLength < PAIR_CODE_LENGTH_ and
253245
codeLength % 2 == 1):
254246
raise ValueError('Invalid Open Location Code length - ' +
@@ -305,8 +297,6 @@ def encode(latitude, longitude, codeLength=PAIR_CODE_LENGTH_):
305297
codeLength) + SEPARATOR_
306298

307299

308-
309-
310300
def decode(code):
311301
"""
312302
Decodes an Open Location Code into the location coordinates.
@@ -318,7 +308,6 @@ def decode(code):
318308
A CodeArea object that provides the latitude and longitude of two of the
319309
corners of the area, the center, and the length of the original code.
320310
"""
321-
322311
if not isFull(code):
323312
raise ValueError(
324313
'Passed Open Location Code is not a valid full code - ' + str(code))
@@ -383,8 +372,6 @@ def decode(code):
383372

384373

385374

386-
387-
388375
def recoverNearest(code, referenceLatitude, referenceLongitude):
389376
"""
390377
Recover the nearest matching code to a specified location.
@@ -455,8 +442,6 @@ def recoverNearest(code, referenceLatitude, referenceLongitude):
455442
codeArea.codeLength)
456443

457444

458-
459-
460445
def shorten(code, latitude, longitude):
461446
"""
462447
Remove characters from the start of an OLC code.
@@ -505,8 +490,6 @@ def shorten(code, latitude, longitude):
505490
return code
506491

507492

508-
509-
510493
def clipLatitude(latitude):
511494
"""
512495
Clip a latitude into the range -90 to 90.
@@ -516,8 +499,6 @@ def clipLatitude(latitude):
516499
return min(90, max(-90, latitude))
517500

518501

519-
520-
521502
def computeLatitudePrecision(codeLength):
522503
"""
523504
Compute the latitude precision value for a given code length. Lengths <=
@@ -530,8 +511,6 @@ def computeLatitudePrecision(codeLength):
530511
return pow(20, -3) / pow(GRID_ROWS_, codeLength - 10)
531512

532513

533-
534-
535514
def normalizeLongitude(longitude):
536515
"""
537516
Normalize a longitude into the range -180 to 180, not including 180.
@@ -545,8 +524,6 @@ def normalizeLongitude(longitude):
545524
return longitude
546525

547526

548-
549-
550527
class CodeArea(object):
551528
"""
552529
Coordinates of a decoded Open Location Code.

0 commit comments

Comments
 (0)