Double resolution trimmed in GeoJSONWriter
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start at GeoJSONWriter and trace how coordinate resolution is selected for JtsSpatialContext.GEO. Reproduce the reported bounding box output, then verify that the resulting GeoJSON preserves sufficient coordinate precision and does not create duplicate points that Elasticsearch rejects.
Written by the indexing model from the issue text.
Description
I'm wondering if there is a reason for setting the lat/lon resolution in GeoJSONWriter to 6 decimal places?
I came across the following SW, NE bounding box from a geocoder
(53.3747317, -2.2614302
53.3747324, -2.2608337)
The GeoJSONWriter (using JtsSpatialContext.GEO) returned the following:
{
"type": "Polygon",
"coordinates": [
[
[
-2.26143,
53.374732
],
[
-2.26143,
53.374732
],
[
-2.260834,
53.374732
],
[
-2.260834,
53.374732
],
[
-2.26143,
53.374732
]
]
]
}
The first and second point are identical, which threw an exception when I tried to index it within Elasticsearch.
Is there an alternative way to convert the Shape to GeoJSON so it does not trim the values?
In the meantime, I am using BigDecimal.valueOf(doubleValue).toPlainString(). Is that something that can / should be changed in Spatial4j?
- Dominant language
- Java
- Stars
- 961
- Forks
- 172
- PR merge metrics
- No merged PRs in 30d
Contributor 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 ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 45/100
locationtech/spatial4j#227 · 2 comments ·
All issues in locationtech/spatial4j
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100