GIScience / GIScience/ohsome-planet
Non-multipolygon relations get bounding box as geometry instead of actual geometry
- Dominant language
- Java
- Stars
- 61
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
## Description
When processing a planet PBF with `ohsome-planet contributions`, all non-multipolygon relation types receive their bounding box as geometry instead of their actual assembled geometry, even with `--multipolygon-member-limit -1`.
For example, [relation 2195878](https://www.openstreetmap.org/relation/2195878) (Río Aragón,`type=waterway`) outputs a rectangular polygon matching its bbox coordinates exactly:
> POLYGON ((-1.7876927 42.2204245, -1.7876927 42.8105252, -0.5049919 42.8105252, -0.5049919 42.2204245, -1.7876927 42.2204245))
This affects a large number of relations. On a recent planet extract (~1.45 billion features), approximately 5.4 million relations have exactly 5 points (bounding box rectangle). Affected relation types include waterway, route, boundary (non-multipolygon), and others.
## Expected behavior
Relations should have their actual geometry assembled from member ways/nodes, similar to how multipolygon relations are handled via `--multipolygon-member-limit`.
## Steps to reproduce
```bash
ohsome-planet contributions --pbf planet-latest.osm.pbf --data output --multipolygon-member-limit -1
```
Then query the output:
```
-- Show bbox-only relations by type
SELECT tags['type'] as relation_type, COUNT(*) as cnt
FROM 'output/contributions/latest/*.parquet'
WHERE osm_type = 'relation' AND ST_NPoints(geometry) = 5
GROUP BY relation_type ORDER BY cnt DESC;
```
For context, setting `--multipolygon-member-limit` to `-1` (unlimited) only enables geometry assembly for multipolygon relations. It seems there is currently no option to enable geometry assembly for other relation types (waterway, route, boundary, etc.).
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the `ohsome-planet contributions` entry point and trace how relation geometry is assembled when `--multipolygon-member-limit -1` is used. Reproduce the issue with the supplied command, then run the DuckDB query against the Parquet output. Done means non-multipolygon relations such as waterway and route relations contain assembled member geometry rather than five-point bounding-box rectangles.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, data-engineering
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100