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

update: roll back to older commit

parent 5e108bba
No related branches found
No related tags found
1 merge request!7Clhp map
......@@ -37,7 +37,7 @@ def get_relation(self, body_of_water: str): # NB: implement body_of_water
ax.set_aspect(1.5)
# Plot each tile
for tile in tiles[45:60]: # NB temporarily limited to 5 tiles
for tile in tiles: # NB temporarily limited to 5 tiles
random_color = "#{:06x}".format(random.randint(0, 0xFFFFFF))
gpd.GeoSeries(tile.geometry).plot(ax=ax, facecolor=random_color, edgecolor='none')
......@@ -48,15 +48,16 @@ def get_relation(self, body_of_water: str): # NB: implement body_of_water
features = []
sub_div_id = 0
for tile in divided_map[45:60]: # NB temporarily limited to 5 tiles
for tile in divided_map: # 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)
if isinstance(tile, Polygon):
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',
......
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