topojson
doesn't parse ;
-delimited CSV files. You need to use ,
or \t
(the latter preferably with a file extension .tsv
).
See https://github.com/mbostock/topojson/blob/master/bin/topojson#L369-L374
Question
I am trying to link a shapefile europe.shp
with a data.csv
external file while producing a TopoJSON file. They both have the iso_a3
country code as common ID.
This is the head of data.csv
:
iso_a3;anzahl_jets;typen1;typen2;typen3;text;pop
ALB;;;;;;3639453
AND;;;;;;83888
AUT;15;15 Eurofighter;;;;8210281
BEL;81;59 F-16;22 alte Saab;;;10414336
Converting europe.shp
to europe.json
alone works fine, all properties are preserved.
When using the below statement though, only the properties of europe.shp
are preserved (iso_a3 and name_de).
topojson --id-property iso_a3 -o europe.json -p iso_a3,jets=+anzahl_jets,pop=+pop,name_de=name_de --simplify-proportion 0.25 --width 900 --height 600 --external-properties data.csv -- countries=europe.shp
What am I doing wrong?
Solution
topojson
doesn't parse ;
-delimited CSV files. You need to use ,
or \t
(the latter preferably with a file extension .tsv
).
See https://github.com/mbostock/topojson/blob/master/bin/topojson#L369-L374