def on_post(self, req, resp):
"""Handles POST requests"""
resp.status = falcon.HTTP_200
# grab 'geojson' from req.context
data = req.context['geojson']
# get coordinates from geojson
coords = spatial.from_list_to_ewkt(
spatial.coordinates_from_geojson(data)
)
print(coords)
# create the controller view
controller = Controller(coords)
# find the areas contained by controller's view and connected points' data
controller.which_areas_contains_this_polygon()
# dump the retrieved data
json = controller.serialize_features_from_database()
print(str(controller))
print(json)
req.context['result'] = json
评论列表
文章目录