def test_should_return_all_the_xco2_in_a_geometry(self): # create a controller controller = Controller(self.polygon_big) #print(self.polygon_big) # find the areas contained by controller's view controller.which_areas_contains_this_polygon() # return the JSON points contained by the areas #print(areas) json = controller.serialize_features_from_database() print(json)
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
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