gpt4 book ai didi

javascript - geoJson 未验证

转载 作者:行者123 更新时间:2023-12-03 04:32:07 26 4
gpt4 key购买 nike

我有以下 geoJson 多边形:

{"type": "Feature","geometry":{"type":"MultiPolygon", "coordinates":[[[[103.76772700000001,1.47063],[103.76772700000001,1.4795775862068967],[103.758794,1.4795775862068967],[103.758794,1.47063],[103.76772700000001,1.47063]]]]},"properties": {"number":"01"}},

{"type": "Feature","geometry":{"type":"MultiPolygon", "coordinates":[[[[104.00891800000001,1.47063],[104.00891800000001,1.4795775862068967],[103.99998500000001,1.4795775862068967],[103.99998500000001,1.47063],[104.00891800000001,1.47063]]]]},"properties": {"number":"03"}}

但是当我在 geojson validator 中验证这一点时它会抛出 EOF 错误。但是当我分别尝试每个时,它都会被验证为合格的 geoJSON。所以我也尝试过这个。

"type":"FeatureCollection","features":[

{"type": "Feature","geometry":{"type":"MultiPolygon", "coordinates":[[[[103.76772700000001,1.47063],[103.76772700000001,1.4795775862068967],[103.758794,1.4795775862068967],[103.758794,1.47063],[103.76772700000001,1.47063]]]]},"properties": {"number":"01"}},

{"type": "Feature","geometry":{"type":"MultiPolygon", "coordinates":[[[[104.00891800000001,1.47063],[104.00891800000001,1.4795775862068967],[103.99998500000001,1.4795775862068967],[103.99998500000001,1.47063],[104.00891800000001,1.47063]]]]},"properties": {"number":"03"}}

]

但仍然抛出 EOF 错误。如有任何帮助,我们将不胜感激。

最佳答案

它应该是一个 JSON 对象。您缺少 {}

{
"type": "FeatureCollection",
"features": [

{
"type": "Feature",
"geometry": {
"type": "MultiPolygon",
"coordinates": [
[
[
[103.76772700000001, 1.47063],
[103.76772700000001, 1.4795775862068967],
[103.758794, 1.4795775862068967],
[103.758794, 1.47063],
[103.76772700000001, 1.47063]
]
]
]
},
"properties": {
"number": "01"
}
},

{
"type": "Feature",
"geometry": {
"type": "MultiPolygon",
"coordinates": [
[
[
[104.00891800000001, 1.47063],
[104.00891800000001, 1.4795775862068967],
[103.99998500000001, 1.4795775862068967],
[103.99998500000001, 1.47063],
[104.00891800000001, 1.47063]
]
]
]
},
"properties": {
"number": "03"
}
}

]
}

关于javascript - geoJson 未验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43445008/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com