def get(self): args = address_parser.parse_args() query = args['q'] Logger.info("Look for IRIS for address '%s'", address) coord = address.coordinate(query) Logger.info("Get coordinate (%s, %s)", coord["lon"], coord["lat"]) Logger.info("For address '%s'", coord["address"]) if coord['address'] is None: return [] res = extract.iris_from_coordinate(coord['lon'], coord['lat']) res.update(coord) return res
def get(self, query): Logger.info("Looking for the list of iris in the city matching the query %s", query) Logger.info("Looking for longitude and latitude for the query %s", query) coord=address.coordinate(query) if coord["address"] is None: # Requests sent to '/api/search' that match nothing do not return a 404 error like other requests. # Is this an intentional choice? api.abort(404, "No city found matching that query") # I'm pretty sure the preferred order is usually latitude first, then longitude Logger.info("Looking for iris at coordinates %s, %s", coord["lat"], ["lon"]) iris=extract.iris_from_coordinate(coord["lon"], coord["lat"]) iris_list=extract.get_iris_list_by_city_code(iris["citycode"]) return {"city_name": iris["city"], "city_code": iris["citycode"], "iris_list": iris_list}
def get(self): args = address_parser.parse_args() q, postcode, citycode, lat, lon, limit = args['q'], args[ 'postcode'], args['citycode'], args['lat'], args['lon'], args[ 'limit'] Logger.info( "Look for IRIS for q '%s', postcode '%s', citycode '%s', lat '%s' , lon '%s', limit '%s'", q, postcode, citycode, lat, lon, limit) coord = address.coordinate(q, postcode, citycode, lat, lon, limit) Logger.info("Get coordinate (%s, %s)", coord["lon"], coord["lat"]) Logger.info("For address '%s'", coord["address"]) if coord['address'] is None: return [] res = extract.iris_from_coordinate(coord['lon'], coord['lat'], args['geojson']) res.update(coord) return res
def get(self, query): Logger.info( "Looking for the list of iris in the city matching the query %s", query) Logger.info("Looking for longitude and latitude for the query %s", query) coord = address.coordinate(query) if coord["address"] is None: # Requests sent to '/api/search' that match nothing do not return a 404 error like other requests. # Is this an intentional choice? api.abort(404, "No city found matching that query") # I'm pretty sure the preferred order is usually latitude first, then longitude Logger.info("Looking for iris at coordinates %s, %s", coord["lat"], ["lon"]) iris = extract.iris_from_coordinate(coord["lon"], coord["lat"]) iris_list = extract.get_iris_list_by_city_code(iris["citycode"]) return { "city_name": iris["city"], "city_code": iris["citycode"], "iris_list": iris_list }
def get(self): args = address_parser.parse_args() q, postcode, citycode, lat, lon, limit = args['q'], args[ 'postcode'], args['citycode'], args['lat'], args['lon'], args[ 'limit'] Logger.info( "Look for a list of IRIS in a city for q '%s', postcode '%s', citycode '%s', lat '%s' , lon '%s', limit '%s'", q, postcode, citycode, lat, lon, limit) coord = address.coordinate(q, postcode, citycode, lat, lon, limit) if coord["address"] is None: # Requests sent to '/api/search' that match nothing do not return a 404 error like other requests. # Is this an intentional choice? api.abort(404, "No city found matching that query") # I'm pretty sure the preferred order is usually latitude first, then longitude Logger.info("Looking for iris at coordinates %s, %s", coord["lat"], ["lon"]) iris = extract.iris_from_coordinate(coord["lon"], coord["lat"]) iris_list = extract.get_iris_list_by_city_code(iris["citycode"]) return { "city_name": iris["city"], "city_code": iris["citycode"], "iris_list": iris_list }