X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/86c4897c9b49610ac0eea5fac0d8eeb67384da36..6ef4d04b46c4461db9a571f5c8b0c72d34cd9335:/nominatim/api/v1/server_glue.py diff --git a/nominatim/api/v1/server_glue.py b/nominatim/api/v1/server_glue.py index 40081c03..68cf58c2 100644 --- a/nominatim/api/v1/server_glue.py +++ b/nominatim/api/v1/server_glue.py @@ -227,8 +227,11 @@ class ASGIAdaptor(abc.ABC): def parse_geometry_details(self, fmt: str) -> napi.LookupDetails: + """ Create details strucutre from the supplied geometry parameters. + """ details = napi.LookupDetails(address_details=True, - geometry_simplification=self.get_float('polygon_threshold', 0.0)) + geometry_simplification= + self.get_float('polygon_threshold', 0.0)) numgeoms = 0 if self.get_bool('polygon_geojson', False): details.geometry_output |= napi.GeometryFormat.GEOJSON @@ -348,7 +351,7 @@ async def lookup_endpoint(api: napi.NominatimAPIAsync, params: ASGIAdaptor) -> A details = params.parse_geometry_details(fmt) places = [] - for oid in params.get('osm_ids', '').split(','): + for oid in (params.get('osm_ids') or '').split(','): oid = oid.strip() if len(oid) > 1 and oid[0] in 'RNWrnw' and oid[1:].isdigit(): places.append(napi.OsmID(oid[0], int(oid[1:])))