Skip to content

Fix GeoJSONReader NPE when coordinates appear before type - #239

Open
arimu1 wants to merge 1 commit into
locationtech:masterfrom
arimu1:fix/227-geojson-property-order
Open

arimu1 wants to merge 1 commit into
locationtech:masterfrom
arimu1:fix/227-geojson-property-order

Conversation

@arimu1

@arimu1 arimu1 commented Nov 22, 2026

Copy link
Copy Markdown

Summary

Fixes #227

Test plan

  • Confirmed the reporter polygon NPEs on current master at GeoJSONReader.readShapeFromCoordinates.
  • mvn --batch-mode -Dtest=org.locationtech.spatial4j.io.GeneralGeoJSONTest#testParsePolygonCoordinatesBeforeType,org.locationtech.spatial4j.io.GeneralGeoJSONTest#testParsePolygon,org.locationtech.spatial4j.io.jackson.JacksonGeoJSONReaderTest#testParsePolygonCoordinatesBeforeType test — 3/3 Temurin 21
  • mvn --batch-mode -Dtest=org.locationtech.spatial4j.io.GeneralGeoJSONTest test — 30/30 Temurin 21

Made with Cursor

RFC 7946 says member order is irrelevant. Buffer coordinates until
type is known so GeoJSONReader no longer NPEs.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GeoJSONs cannot be read when the properties are ordered differently than expected

1 participant