Simplify topojson via command line tool

I'm trying to simplify "world-110m.json" as mentioned in this thread...Topojson: quantization VS simplificationWhich also references the documentation...https://github.com/mbostock/topojson/wiki/Command-Line-ReferenceI've got the tool installed but am really struggling to find an example input that works for me (even with the mentioned documentation). For example, I'm trying to do something like..."topojson -s 1e5 -o output.json --world-110m.json"But it's just hanging. The reasons I want to try simplifying world-110m.json are...1) Sometimes I ...Read more

Is there a way to change the projection in a topojson file?

I am trying to create a topojson file projected using geoAlbersUsa, originating from the US Census's ZCTA (Zip Codes, essentially) shapefile. I was able to successfully get through the examples in the excellent https://medium.com/@mbostock/command-line-cartography-part-1-897aa8f8ca2c using the specified maps, and now I'm trying to get the same result using the Zip Code-level shapefiles.I keep running into various issues due to the size of the file and the length of the strings within the file. While I have been able to create a geojson file a...Read more

topojson - Vega maps highlighting

i'm experimenting in enabling Vega graphs/maps on Wikipedia, and looking for a way to draw a map with different countries highlighted with different colors. So for the map at http://graphtest.wmflabs.org/wiki/Graph:Map I would like to have another table, e.g. US=red,FR=green,HE=blue, etc, which would highlight given countries with colors. Graph's definition uses numeric country IDs, so in reality I will have a table "10":"red", etc. What I can't seem to figure out, is how to mix countries data with highlighting in vega json.Feel free to edit t...Read more

Adding external properties to TopoJSON file of counties

related questionI'm trying to add external properties to a topojson file, us-counties.json (made with us-atlas using make topo/us-counties.json). I'm working off this example. But my resulting topojson file us-counties-with-population.json has no properties at all. My call looks like:topojson --external-properties data.csv \ --id-property id_county \ --properties population=+percent_population \ -o us-counties-with-population.json \ -- us-counties.jsonand my data looks like (head -n5 data.csv):id_county,county_name,percent_population01003,...Read more

Tried to install topoJSON and got this

Caseys-MacBook-Pro:~ casey$ npm install -g topojsonnpm http GET https://registry.npmjs.org/topojsonnpm http 200 https://registry.npmjs.org/topojsonnpm http GET https://registry.npmjs.org/topojson/-/topojson-1.1.4.tgznpm http 200 https://registry.npmjs.org/topojson/-/topojson-1.1.4.tgznpm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/topojson'npm ERR! { [Error: EACCES, mkdir '/usr/local/lib/node_modules/topojson']npm ERR! errno: 3,npm ERR! code: 'EACCES',npm ERR! path: '/usr/local/lib/node_modules/topojson',npm ERR! fstream_typ...Read more

topojson.merge using command line API

I have a topojson file of all US states that I would like to merge into a single entity, i.e. removing common arcs.Several answers suggest using topojson.mesh(), as is pointed out in the answer here:D3: Merge interior svg paths?However I would like to save the output topojson for reuse in the future. So is there a way to manipulate the original file through the command line tool instead?Thanks...Read more

combining different files with topojson at different simplification levels

I would like to combine three geojson files into one topojson file. two of these files are pretty straightforward shapefiles. they need no simplifying.one of them is the 10m cultural natural earth vector file. it's geojson is 24.8mb. I need the 10m because i need small islands to remain on the map (though i'll likely simplify them out but retain them with --allow-empty).is it possible to simplify the 10m cultural file with topojson, then combine it with the other two geojson files using topojson but without simplifying?or is this a totally croo...Read more

How do you convert TopoJSON linestring to polygon?

I have a TopoJSON file containing the boundaries of various districts in Uttar Pradesh, India. When you load the data on a map, you see only the outlines of the districts; the districts themselves are not filled.I believe the problem is that each district is of type GeometryCollection that has its own geometries made up of a series of LineStrings.Instead, I want each district to be of type Polygon that just has arcs.For example, the first object is: { "type": "GeometryCollection", "geometries": [{ "type": "GeometryCo...Read more

Hand-Generated TopoJSON not Parsing

I wrote a simple function to parse a the results of d3.geom.voronoi into topoJSON format, which you can see here:http://bl.ocks.org/emeeks/9908143As far as I can tell, it matches up with the topoJSON generated in http://bl.ocks.org/mbostock/5249328 except that it doesn't use translate or scale (though I've generated it with a translate of (0,0) and a scale of (1) and received the same error). When I try to parse the features with topojson, I receive this error:TypeError: Cannot read property 'length' of undefinedat arc (topojson.js:172:54)at li...Read more

Trouble installing topojson on Mac OSX

Enticed by d3, I'm also working from the "Let's map" tutorial (http://bost.ocks.org/mike/map/) and running into a problem installing topojson with the command npm install -g topojson. I installed homebrew and installed node, and both check. GDAL was installed earlier during a python install, version 1.10.0.Here's some of the error log (I hope the relevant part): 44 silly gunzTarPerm modes [ '755', '644' ] 45 error Error: EACCES, mkdir '/usr/local/lib/node_modules/topojson' 45 error { [Error: EACCES, mkdir '/usr/local/lib/node_modules/topojs...Read more