Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The filter geometry:polygon returns multilines and geometrycollections #339

Open
dgatland opened this issue Feb 12, 2025 · 0 comments · May be fixed by GIScience/oshdb#535
Open

The filter geometry:polygon returns multilines and geometrycollections #339

dgatland opened this issue Feb 12, 2025 · 0 comments · May be fixed by GIScience/oshdb#535
Labels
bug Something isn't working

Comments

@dgatland
Copy link

Bug Description

When calling the /v1/elements/geometry/ endpoint, with the filter geometry:polygon, the response may include MutliLines and GeometryCollections (see attached response_geometries, in particular the LineString returned in the Lütgendortmund boundary near Bövinghausen).

Our example query includes the following parameters:

'bpolys': {'type': 'FeatureCollection', 'features': [<see attached aoi>]},
'filter': 'geometry:polygon and boundary=administrative and admin_level=9',
'properties': 'tags',
'clipGeometry': 'true'

General Information

  • Version of the ohsome API: 1.10.4
  • Remote instance at https://api.ohsome.org/v1
  • Affected endpoint: /elements/geometry
  • URL of request: https://api.ohsome.org/v1/elements/geometry, body=bpolys=<see attached aoi>&filter=geometry%3Apolygon+and+boundary%3Dadministrative+and+admin_level%3D9&properties=tags&clipGeometry=True
  • Used HTTP method: POST
  • Utilized tool/library: ohsome-py==0.3.0

Expected Behaviour

The response should contain only polygons.

Further Information

Related Issues

May be related to #109

Attachments

response_geometries.json
aoi.json

@dgatland dgatland added the bug Something isn't working label Feb 12, 2025
tyrasd added a commit to GIScience/oshdb that referenced this issue Feb 20, 2025
when a geometry only touches the clipping polygon (and has no points inside the poly), `intersector.intersection()` will produce a "degenerate" version of the original geometry: a (multi)linestring when the geometry was a polygon, or a (multi)point when the geometry was a linestring.
This can lead to inconsistencies when a geometry-type filter is used (e.g. `geometry: polygon`), as the output will then potentially also contain geometries that don't match the filter.

Fixes GIScience/ohsome-api#339
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant