Skip to content

TurfTransformation.circle produces invalid GeoJSON #884

@sniok

Description

@sniok
  • Bug Report can be reported using the provided template below:

Expected Behavior

As per GeoJSON specification (Section 3.1.6) a valid polygon must have the same first and last point.

The first and last positions are equivalent, and they MUST contain
identical values; their representation SHOULD also be identical.

Current Behavior

Current implementation generates circle where first and last point are not the same. This is reflected in tests where expected circle polygon is incorrect.

$ geojsonhint circle_out.json
  1:1  error  the first and last positions in a LinearRing of coordinates must be the same

✖ 1 error

Possible Solution/Implementation

Add first point to coordinates list in circle method
https://github.com/mapbox/mapbox-java/blob/master/services-turf/src/main/java/com/mapbox/turf/TurfTransformation.java#L65

Steps to Reproduce

  1. Run TurfTransformationTest

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