Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Polygon coordinate order is not preserved in Geo JSON sources #8746

Closed

Description

@ivovandongen

I noticed while working on #8007 that the order of the coordinates in polygons is not always preserved correctly.

For example:

[
  [
    [-10, 10],
    [10, 10],
    [10, -10],
    [-10, -10],
    [-10, 10]
  ]
]

Is converted in:

[
  [
    [10, 10],
    [10, -10],
    [-10, -10],
    [-10, 10],
    [10, 10]
  ]
]

Which is functionally the same, but not identical.

The bug seems to be caused in GeoJSONTileFeature::getGeometries
which calls fixupPolygons as a workaround to mapbox/geojson-vt-cpp#44.

Activity

  1. added
    Core
    on Apr 14, 2017
  2. ivovandongen commented on Apr 18, 2017

    @ivovandongen
    ContributorAuthor
  3. mourner commented on Apr 18, 2017

    @mourner
    Member

    I'd suggest looking into writing a custom comparator for rings that handles shifted coordinates.

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

    Core

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions