X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/a413aae8a3962be4d623844d867604df68a9a211..56f9535aa9cf3f9f500471603e5876cd3e0ddb0b:/nominatim/api/v1/helpers.py diff --git a/nominatim/api/v1/helpers.py b/nominatim/api/v1/helpers.py index 62e5e943..325e5bc6 100644 --- a/nominatim/api/v1/helpers.py +++ b/nominatim/api/v1/helpers.py @@ -62,13 +62,13 @@ def extend_query_parts(queryparts: Dict[str, Any], details: Dict[str, Any], """ parsed = SearchDetails.from_kwargs(details) if parsed.geometry_output != GeometryFormat.NONE: - if parsed.geometry_output & GeometryFormat.GEOJSON: + if GeometryFormat.GEOJSON in parsed.geometry_output: queryparts['polygon_geojson'] = '1' - if parsed.geometry_output & GeometryFormat.KML: + if GeometryFormat.KML in parsed.geometry_output: queryparts['polygon_kml'] = '1' - if parsed.geometry_output & GeometryFormat.SVG: + if GeometryFormat.SVG in parsed.geometry_output: queryparts['polygon_svg'] = '1' - if parsed.geometry_output & GeometryFormat.TEXT: + if GeometryFormat.TEXT in parsed.geometry_output: queryparts['polygon_text'] = '1' if parsed.address_details: queryparts['addressdetails'] = '1' @@ -83,7 +83,7 @@ def extend_query_parts(queryparts: Dict[str, Any], details: Dict[str, Any], if parsed.countries: queryparts['countrycodes'] = ','.join(parsed.countries) queryparts['exclude_place_ids'] = \ - ','.join(chain(excluded, map(str, parsed.excluded))) + ','.join(chain(excluded, map(str, (e for e in parsed.excluded if e > 0)))) if parsed.viewbox: queryparts['viewbox'] = ','.join(f"{c:.7g}" for c in parsed.viewbox.coords) if parsed.bounded_viewbox: