【发布时间】:2020-09-17 17:03:35
【问题描述】:
我有一个导出的geoJSON 格式,其中包含一长串多边形坐标。附加前几行,以同样的方式继续:
{
"Type": 8,
"Features": [
{
"Type": 7,
"Id": null,
"Geometry": {
"Type": 4,
"Coordinates": [
{
"Type": 2,
"Coordinates": [
{
"Altitude": null,
"Latitude": 85.683948266763423,
"Longitude": 100.62897140939768
},
{
"Altitude": null,
"Latitude": 86.183185093020128,
"Longitude": 100.62897140939695
},
{
"Altitude": null,
"Latitude": 86.183185093020128,
"Longitude": 102.58500571589823
},
{
"Altitude": null,
"Latitude": 97.662303996119974,
"Longitude": 102.58500571589828
},
{
"Altitude": null,
"Latitude": 97.662303996119988,
"Longitude": 97.853903401585853
},
{
"Altitude": null,
"Latitude": 85.683948266763423,
"Longitude": 97.853903401585839
},
{
"Altitude": null,
"Latitude": 85.683948266763423,
"Longitude": 100.62897140939768
}
],
"BoundingBoxes": null,
"CRS": null
}
],
"BoundingBoxes": null,
"CRS": null
},
"Properties": {
"Name": "Shop",
"Area": 572.15969696515185
},
"BoundingBoxes": null,
"CRS": null
},
{
"Type": 7,
"Id": null,
"Geometry": {
"Type": 4,
"Coordinates": [
{
"Type": 2,
"Coordinates": [
{
"Altitude": null,
"Latitude": 91.298364266763443,
"Longitude": 86.631773715898134
},
{
我尝试在网上查看geoJSON 格式的各种解释,但没有找到关于为什么"Type" 是数字并且与"Polygon" 等实际类型不匹配的信息。
另外,在GeoJSON Viewer & Validator 上进行测试时,我尝试调试并将一些初始行转换为:
{
"type": "MultiPolygon",
"coordinates": [
{
"type": 7,
"Id": null,
"Geometry": {
"Type": "Polygon",
"Coordinates": [
{
"Type": 2,
"Coordinates": [
{
"Altitude": null,
"Latitude": 85.683948266763423,
"Longitude": 100.62897140939768
},
我将Type 替换为type,将8 替换为MultiPolygon 等。
在上述情况下,每个多边形都会出现以下错误:
第 5 行:在坐标数组应该存在的位置找到了一个数字 发现:这需要嵌套更深
我不确定要对格式进行哪些更改以使其与验证器保持一致。我认为导出格式可能很旧,但我不是构建它的人,所以也许手动替换某些字段可以解决问题。
有什么建议吗?
【问题讨论】:
标签: json formatting polygon geojson