]> git.openstreetmap.org Git - nominatim.git/blobdiff - nominatim/api/lookup.py
add unit tests for lookup function
[nominatim.git] / nominatim / api / lookup.py
index 410d030c6f91a35b13b923d18d765b1c8752bdd4..2934425ab60f6b3df761d2f8944499ad3b756120 100644 (file)
@@ -23,8 +23,8 @@ def _select_column_geometry(column: SaColumn,
     """
     if geometry_output & ntyp.GeometryFormat.GEOJSON:
         return sa.literal_column(f"""
-                  ST_AsGeoJSON(CASE WHEN ST_NPoints({0}) > 5000
-                               THEN ST_SimplifyPreserveTopology({0}, 0.0001)
+                  ST_AsGeoJSON(CASE WHEN ST_NPoints({column.name}) > 5000
+                               THEN ST_SimplifyPreserveTopology({column.name}, 0.0001)
                                ELSE {column.name} END)
                   """).label('geometry_geojson')