Skip to content

Commit

Permalink
add doc strings to new functions #73
Browse files Browse the repository at this point in the history
  • Loading branch information
cahytinne committed Apr 20, 2017
1 parent 832b0b4 commit 6b8306e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions crabpy/gateway/capakey.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,11 +506,23 @@ def __init__(self, **kwargs):

@staticmethod
def _parse_centroid(center):
'''
Parse response center from the CapakeyRestGateway to (CenterX, CenterY)
:param center: response center from the CapakeyRestGateway
:return: (CenterX, CenterY)
'''
coordinates = json.loads(center)["coordinates"]
return coordinates[0], coordinates[1]

@staticmethod
def _parse_bounding_box(bounding_box):
'''
Parse response bounding box from the CapakeyRestGateway to (MinimumX, MinimumY, MaximumX, MaximumY)
:param bounding_box: response bounding box from the CapakeyRestGateway
:return: (MinimumX, MinimumY, MaximumX, MaximumY)
'''
coordinates = json.loads(bounding_box)["coordinates"]
x_coords = [x for x, y in coordinates[0]]
y_coords = [y for x, y in coordinates[0]]
Expand Down

0 comments on commit 6b8306e

Please sign in to comment.