예제 #1
0
 def get(self):
     args = coord_parser.parse_args()
     lat = args['lat']
     lng = args['lng']
     Logger.info("Look for IRIS for coordinate '%s, %s'", lat, lng)
     res = extract.iris_from_coordinate(lng, lat)
     return res
예제 #2
0
파일: app.py 프로젝트: garaud/pyris
 def get(self):
     args = coords_parser.parse_args()
     lat, lon = args['lat'], args['lon']
     Logger.info("Coordinates '%s'", (lon, lat))
     Logger.info("geojson? %s", args['geojson'])
     res = extract.iris_from_coordinate(lon, lat, args['geojson'])
     if not res:
         api.abort(404, "IRIS not found from coordinates ({}, {})".format(lat, lon))
     return res
예제 #3
0
 def get(self):
     args = coords_parser.parse_args()
     lat, lon = args['lat'], args['lon']
     Logger.info("Coordinates '%s'", (lon, lat))
     Logger.info("geojson? %s", args['geojson'])
     res = extract.iris_from_coordinate(lon, lat, args['geojson'])
     if not res:
         api.abort(
             404,
             "IRIS not found from coordinates ({}, {})".format(lat, lon))
     return res
예제 #4
0
 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
예제 #5
0
파일: app.py 프로젝트: armgilles/pyris
 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
예제 #6
0
파일: app.py 프로젝트: garaud/pyris
 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}
예제 #7
0
 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
예제 #8
0
 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
     }
예제 #9
0
파일: app.py 프로젝트: remisultan/pyris
 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
     }