Skip to content

Non-multipolygon relations get bounding box as geometry instead of actual geometry #47

@laurentpellegrino

Description

@laurentpellegrino

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 (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

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.).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions