Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Polygon.toJson() does not serialize double values with precisions over 8 digits properly

未關閉
#1,085 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
35/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
java
領域
api

研究方向

從 Polygon.toJson() 開始,追蹤多邊形的座標值如何被序列化。使用報告中的緯度和經度值重現問題,然後確認產生的 JSON 是否保留了報告中的精度。payload 未指定原始碼檔案或測試,因此需要在 repository 中找到它們。

由索引模型根據 Issue 內容生成。

描述

GeoJson

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

主要語言
Java
星號
438
分支
117
PR 合併指標
30 天內沒有已合併 PR

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

mapbox/mapbox-java 的其他 Issue

查看 mapbox/mapbox-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。