diff --git a/server/map/__pycache__/get_relation.cpython-311.pyc b/server/map/__pycache__/get_relation.cpython-311.pyc index 948472060202eb3732deb69ff9f71247da057b8f..aa9d38516dd833f6e5af95e22894dbd1ee066866 100644 Binary files a/server/map/__pycache__/get_relation.cpython-311.pyc and b/server/map/__pycache__/get_relation.cpython-311.pyc differ diff --git a/server/map/get_relation.py b/server/map/get_relation.py index 945c02786bb03dfafd4c88ee67623ef558429dc0..d930473dbcb17e015e0548230c6335767dc8a593 100644 --- a/server/map/get_relation.py +++ b/server/map/get_relation.py @@ -49,14 +49,22 @@ def get_relation(self, body_of_water: str): # NB: implement body_of_water sub_div_id = 0 for tile in divided_map[45:60]: # NB temporarily limited to 5 tiles + + # Round coordinates to 4 decimals center = round(tile.centroid.coords[0][0], 4), round(tile.centroid.coords[0][1], 4) + rounded_coordinates = [] + for coords in tile.exterior.coords: + rounded_coords = (round(coords[0], 4), round(coords[1], 4)) + rounded_coordinates.append(rounded_coords) + rounded_tile = Polygon(rounded_coordinates) + tile_feature = { 'type': 'Feature', 'properties': { 'sub_div_id': sub_div_id, 'sub_div_center': center }, - 'geometry': tile.__geo_interface__ + 'geometry': rounded_tile.__geo_interface__ } features.append(tile_feature) sub_div_id += 1