Polygon.toJson() does not serialize double values with precisions over 8 digits properly
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 35/100
Research direction
Start at Polygon.toJson() and trace how the polygon's coordinate values are serialized. Reproduce the issue with the latitude and longitude values in the report, then verify that the resulting JSON preserves the reported precision. The payload does not name a source file or test, so those will need to be located in the repository.
Written by the indexing model from the issue text.
Description
When I covert the lat, lan values below to polygon and convert the polygon to json using toJson method it removes some digits from lat, lan values(it takes just 6 - 7 digits).
| Lat | Lan |
|---|---|
| 34.8859309407532 | -93.1640625 |
| -15.6230368315283 | -82.265625 |
| -22.917922936146 | -35.15625 |
| -7.01366792756663 | 18.28125 |
| 45.5832897560063 | 2.4609375 |
| 54.3677585240684 | -64.3359375 |
Here is the json output
{
"type": "Polygon",
"coordinates": [
[
[
-93.1640625,
34.8859309
],
[
-82.265625,
-15.6230368
],
[
-35.15625,
-22.9179229
],
[
18.28125,
-7.0136679
],
[
2.4609375,
45.5832898
],
[
-64.3359375,
54.3677585
],
[
-93.1640625,
34.8859309
]
]
]
}
it should construct json correctly. could not use the library
- Dominant language
- Java
- Stars
- 438
- Forks
- 117
- 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 mapbox/mapbox-java
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
mapbox/mapbox-java#1640 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
mapbox/mapbox-java#1635 ·
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
mapbox/mapbox-java#1619 ·
-
Mapbox-java incompatible with gson 2.13.0 and up - call to internal GSON classes that were renamed Open
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
mapbox/mapbox-java#1614 · 2 comments · 1 reaction ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
mapbox/mapbox-java#1612 · 1 reaction ·
All issues in mapbox/mapbox-java
Similar issues
-
bug untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
opensearch-project/ml-commons#5094 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
emitter:client:csharp feature
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
affects/8.10 affects/8.9 component/clients kind/bug likelihood/mid severity/mid
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Two open-case totals on one screen: the Programs tile says 15,858 and the nav badge says 15,868 Openbug frontend maui-pilot
Difficulty 2/5 1-3 hours Newbie friendliness 72/100