Skip to content
Snippets Groups Projects
Commit 5e108bba authored by Sara Savanovic Djordjevic's avatar Sara Savanovic Djordjevic
Browse files

update: part of map in app

parent 4200da98
No related branches found
No related tags found
1 merge request!7Clhp map
No preview for this file type
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment