böyle bir data.tsv dosyası Verilen: (yapı doğrudur, sayısal değerler tesadüfi)Topojson dosyasına özellikler nasıl eklenir?
{
"type":"Topology",
"transform":
{
"scale": [0.0015484881821515486,0.0010301030103010299],
"translate":[-5.491666666666662,41.008333333333354]
},
"objects":
{
"states":
{
"type":"GeometryCollection",
"geometries":
[
{"type":"Polygon","arcs":[[0]],"properties":{"code_2":"AL"}},
{"type":"Polygon","arcs":[[1]],"properties":{"code_2":"AK"}}
]
}
},
"arcs":
[
[[2466,9916],[-25,-5],[3,-13]],
[[2357,9852],[1,-2],[1,-2]]
]
}
nasıl böyle bir topojson.json dosya Verilen
id code name
1 AL Alabama
2 AK Alaska
4 AZ Arizona
5 AR Arkansas
6 CA California
... ... ...
ortak alanların (1) json dosyasına başka bir alanın (2) değerlerini enjekte etmek için kullanılması?
1]: data.txt#code
ve topojson.txt.objects.states.geometries.properties.code_2
2]: data.txt#name
sonuç olmalıdır içerir:
{"type":"Polygon","arcs":[[0]],"properties":{"code_2":"AL", "name":"Alabama" }},
{"type":"Polygon","arcs":[[1]],"properties":{"code_2":"AK", "name":"Alaska" }},
DÜZENLEME: Kabul cevap:
topojson -o final.json -e data.tsv --id-property=code_2,code -p code_2,state=name -- topojson.json
Topojson'u hafifçe düzenledim, böylece her iki şekil de korunur. – Hugolpz