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

fix: tile centers, maybe

parent a023e1af
No related branches found
No related tags found
2 merge requests!9Clhp map,!8Clhp map
This diff is collapsed.
No preview for this file type
No preview for this file type
import json import json
from get_relation import cut_map
# get_markers requests all marker data or valid markers, converts the data to json, and writes # get_markers requests all marker data or valid markers, converts the data to json, and writes
# the data to the response object # the data to the response object
......
...@@ -9,7 +9,7 @@ import os ...@@ -9,7 +9,7 @@ import os
# Read a json file with relation data and send to response object # Read a json file with relation data and send to response object
def cut_map(self, body_of_water: str): # NB: implement body_of_water def cut_map(self, body_of_water: str): # NB: implement body_of_water
# Read relation from GeoJson file and extract all polygons # Read relation from GeoJson file and extract all polygons
geo_data = gpd.read_file("server/map/" + body_of_water + ".json") geo_data = gpd.read_file("server/map/mjosa.geojson")
polygon_data = geo_data[geo_data['geometry'].geom_type == 'Polygon'] polygon_data = geo_data[geo_data['geometry'].geom_type == 'Polygon']
polygons = [Polygon(polygon.exterior) for polygon in polygon_data['geometry']] polygons = [Polygon(polygon.exterior) for polygon in polygon_data['geometry']]
...@@ -82,6 +82,7 @@ def cut_map(self, body_of_water: str): # NB: implement body_of_water ...@@ -82,6 +82,7 @@ def cut_map(self, body_of_water: str): # NB: implement body_of_water
'tile_count': sub_div_id, # Add the last subdivision ID as number of tiles 'tile_count': sub_div_id, # Add the last subdivision ID as number of tiles
} }
write_json_to_file("server/lake_relations", "mjosa", feature_collection)
self.send_response(200) self.send_response(200)
self.send_header("Content-type", "application/json") self.send_header("Content-type", "application/json")
self.end_headers() self.end_headers()
......
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