Putting topojson in the right form to use with D3

20 views
Skip to first unread message

DrunkenPhD

unread,
May 25, 2015, 10:44:32 AM5/25/15
to d3...@googlegroups.com
I am trying to map my topojson file

This file has the syntax as below:

"geometries":[{"type":"Polygon","properties":{"state_code":1,"Area":1796704847.81,"Leng":260823.054469,"Population":25,"name":"BERAT","id":"BERAT"}

showing my map and polygons but all black with no features

I am following an example which use a topojson file with syntax as below:
 
"geometries":[{"type":"MultiPolygon","properties":{"state_code":148,"name":"NO07"},"id":"NO07", ...}, ...]


I think probably there is a problem with my geometry type which is Polygon representing regions inside country versus Multipolygon of example which has collected all polygons (countries) at a Multipolygon
Can you please advice any tool or way to make this converting ?

Regards

Curran

unread,
May 27, 2015, 8:54:13 PM5/27/15
to d3...@googlegroups.com
MapShaper is an excellent tool for converting between formats and simplifying shapes.

Probably you have seen it, but this D3 Choropleth example shows how to use topojson with D3. Using MapShaper I created a similar example, Unemployment in San Mateo County.

It would help a lot if you could post your D3 code in a running form using a tool like JSFiddle, then others could help you debug it and see where it is going wrong with rendering the topojson.

Regards
Reply all
Reply to author
Forward
0 new messages