所有3种情况都在jsonlint中进行验证,但只有第一种情况在mapshaper中显示。
我不明白为什么没有显示案例2和3。
那么,我如何使用“-”来设置这个正确的属性呢?
{"type":"Topology", "crs":{"type":"name","properties":{"name":"EPSG:25832"}},"objects":{"collection": { "type": "GeometryCollection", "geometries":[
{ "type": "MultiPolygon", "arcs": [[[0,1]]],"properties":{"id":9005309}}]}},"arcs":
[
[[565546,7786890.97],[565545.69,7786859.81]],
[[565545.69,7786859.81],[565545.06,7786876.95],[565546,7786890.97]]]
} {"type":"Topology", "crs":{"type":"name","properties":{"name":"EPSG:25832"}},"objects":{"collection": { "type": "GeometryCollection", "geometries":[
{ "type": "MultiPolygon", "arcs": [[[-0,-1]]],"properties":{"id":9005309}}]}},"arcs":
[
[[565545.69,7786859.81],[565546,7786890.97]],
[[565546,7786890.97],[565545.06,7786876.95],[565545.69,7786859.81]]
]
} {"type":"Topology", "crs":{"type":"name","properties":{"name":"EPSG:25832"}},"objects":{"collection": { "type": "GeometryCollection", "geometries":[
{ "type": "MultiPolygon", "arcs": [[[-0,1]]],"properties":{"id":9005309}}]}},"arcs":
[
[[565545.69,7786859.81],[565546,7786890.97]],
[[565545.69,7786859.81],[565545.06,7786876.95],[565546,7786890.97]]]
}发布于 2020-12-15 22:41:37
对负(/reversed)弧有错误的索引:
每个弧必须由基于数字零的索引引用到包含拓扑的弧数组中.例如,0代表第一个弧,1代表第二个弧,依此类推。 负弧指数表示,要重建几何形状,必须反转指数的补数处的弧:-1指第一反弧,-2指反向第二弧,以此类推。在JavaScript中,可以使用位非运算符~i (文档)否定负弧索引i。
而不是-0,您应该使用-1。因此,您的第二个topojson示例应该如下所示:
{"type":"Topology",
"crs":{"type":"name","properties": {"name":"EPSG:25832"}},
"objects":{
"collection": { "type": "GeometryCollection",
"geometries":[
{ "type": "MultiPolygon",
"arcs": [[[-1,-2]]],
"properties":{"id":9005309}}]}},
"arcs":[
[[565545.69,7786859.81],[565546,7786890.97]],
[[565546,7786890.97],[565545.06,7786876.95],[565545.69,7786859.81]]
]
}https://stackoverflow.com/questions/65098222
复制相似问题