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

Handle relations (i.e. geometry collections) corretly on geometry-filter #463

Open
SlowMo24 opened this issue Aug 8, 2022 · 3 comments
Open
Labels
bug Something isn't working as expected

Comments

@SlowMo24
Copy link
Contributor

SlowMo24 commented Aug 8, 2022

Bug Description

The oshdb-filter will only check if the whole element adheres to the geometry-filter. If it is a geometry collection that contains the requested geometry the object will not be included.

How to Reproduce

curl -X GET "https://api.ohsome.org/v1/elements/geometry?bboxes=7.67%2C48.39%2C9.71%2C50.42&clipGeometry=true&filter=id%3Arelation%2F9563275&properties=tags&time=2022-01-01" -H "accept: application/json" returns a geometry collection containing a linestring

curl -X GET "https://api.ohsome.org/v1/elements/geometry?bboxes=7.67%2C48.39%2C9.71%2C50.42&clipGeometry=true&filter=id%3Arelation%2F9563275%20and%20geometry%3Aline&properties=tags&time=2022-01-01" -H "accept: application/json" returns nothing

Expected behaviour

Return the linear elements from the geometry-collection.

Alternative solution

Add a dedicated method for this behaviour and update the documentation.

Further Information

#### Error messages, logs, screenshots

#### Additional Context

System information

  • OS: Ubuntu 20.04 LTS
    - Java Version: [e.g. openjdk version "11.0.9.1"]
  • OSHDB Version: 1.0.0-beta-1
    - Maven version: [e.g. 3.6.3]
@SlowMo24 SlowMo24 added the bug Something isn't working as expected label Aug 8, 2022
@Hagellach37 Hagellach37 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 20, 2022
@SlowMo24
Copy link
Contributor Author

Just noting that I have again encountered this problem today

@maciej-adamiak
Copy link

Hi team. I would be grateful for reopening and working on filtering an exploded geometry collection.

@SlowMo24 SlowMo24 reopened this Jun 12, 2024
@SlowMo24
Copy link
Contributor Author

SlowMo24 commented Jun 12, 2024

Specific use-case: route relations

As any relation they may consist of any type of geometry. Yet it my use case I'm only interested in the linear part (e.g. whats the geometry of a hiking trail/bus route/Bundesautobahn).

Currently I have to query for relations accepting any geometry type and then filter out non-linear objects form the relations on the client side. I would prefer to be able to specify the geometry:line filter and then get only linestrings and multi-linestrings as a response from the API, including linear parts of relations.

Example for a hiking route containing different geometries: https://www.openstreetmap.org/relation/9563275
Example of a route=road relation that is a line but not a simple line but a multi-linestring (due to the two directions at crossing Berliner Ring/Wormser Straße):https://www.openstreetmap.org/relation/1525455
Example of a route=road relation with mixed geometries (this time its a data error IMO): https://www.openstreetmap.org/relation/975202

All are not in returned by the query: https://api.ohsome.org/v1/elements/geometry?bboxes=8.245597%2C48.913029%2C9.009147%2C49.642295&clipGeometry=false&filter=geometry%3Aline%20and%20id%3A(relation%2F9563275%2Crelation%2F975202%2Crelation%2F1525455)&properties=tags%2Cmetadata&time=2024-01-01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

3 participants