]> git.openstreetmap.org Git - nominatim.git/blobdiff - nominatim/api/v1/server_glue.py
Merge pull request #3023 from lonvia/lookup-api
[nominatim.git] / nominatim / api / v1 / server_glue.py
index 40081c039cfdc9478205c4639327631521d6de76..68cf58c285b37858dc90828cde711ac79824743a 100644 (file)
@@ -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:])))