GeoJSONs cannot be read when the properties are ordered differently than expected
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start by reproducing the NullPointerException with the Polygon GeoJSON shown in the issue, then trace the GeoJSON parsing entry point to find where member order is assumed. Confirm the fix by reading equivalent objects with different property orders and checking that both succeed without an exception.
Written by the indexing model from the issue text.
Description
For example, reading this GeoJSON results in a NullPointerException:
{"coordinates":[[[1,0.01],[1,-0.01],[2,-0.02],[3,-0.01],[3,0.01],[1,0.01]]],"type":"Polygon"}
This might not be desirable behaviour, since JSON objects are unordered collections afaik and some JSON parsers do not preserve the order of the properties when serializing/deserializing, but instead order them alphabetically, for example.
It also sounds like this is not intended by the standard (https://www.rfc-editor.org/rfc/rfc7946#section-1.2):
"The ordering of the members of any JSON object defined in this
document MUST be considered irrelevant, as specified by [RFC7159]."
- Dominant language
- Java
- Stars
- 961
- Forks
- 173
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from locationtech/spatial4j
-
question
Difficulty 5/5 Over a week Newbie friendliness 20/100
locationtech/spatial4j#233 · 1 comment ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 35/100
locationtech/spatial4j#232 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
locationtech/spatial4j#231 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
locationtech/spatial4j#230 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 20/100
locationtech/spatial4j#221 ·
All issues in locationtech/spatial4j
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
apache/rocketmq-dashboard#5358 ·
Maintainers usually reply within 3 days
-
area:cpan-port area:database bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
fglock/PerlOnJava#1605 ·
Maintainers usually reply within 1 day
-
1.0.0-rc2
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
wso2/dpdp-accelerator#377 ·
Maintainers usually reply within 1 day
-
area/dependencies backport/26.4 kind/cve severity/high source/scan-dependencies status/triage
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day