Skip to content

Rings through both poles with a full turn can measure more than the globe, silently #1641

Closed

Description

@giswqs

Follow-up from #1632 (#1598).

A degenerate polygon ring that passes through both poles and has a full-turn (-180° to 180°) edge, such as [(-180,90),(180,90),(-90,-90),(90,-80)], can wind past the whole surface. geodesic_ring_area_m2 and wgs84_ring_perimeter_area_m2 then return more than the globe's area, with no notice. This was already the case before #1632. That PR keeps the result the same from every starting vertex but does not change its size.

Such a ring bounds no single region, because closing its winding at either pole gives areas a whole globe apart. Per "Never silent", the callers should report these rings rather than store a number: Spatial Join (crates/analysis/src/join.rs), Calculate Geometry Attributes (crates/analysis/src/tools.rs), $area and the attribute table (crates/data/src/geometry.rs), and the Measure panel. Options are a geom API that flags the ring, which callers count into one notice, or making it an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions