Skip to content

Centroid computation for relations in some cases broken #96

@timonmasberg

Description

@timonmasberg

Describe the bug

Currently, centroids of relations are being calculated by detecting the largest area and calculating the centroid of it. This is broken for some relations, since members of relation-type outer cannot always be seen as one shape. For Hamburg there are multiple way objects that are describing the border. Choosing the largest area therefore is not helpful here.

Steps to Reproduce

Dataset: https://download.geofabrik.de/europe/germany/hamburg.html

Expected behavior

Detecting relation members as closed or open ways. If closed => calculate centroid, if open => create polygon out of them and compute centroid. Also, administrative relations have a admin_centre member, that could be used as a centroid.

Pastebin/Screenshots

Calculated centroid of Hamburg
image

Actual centroid of Hamburg
image

Metadata

Metadata

Assignees

No one assigned

    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