Domanda

I'm attempting to create a TopoJSON file of school districts in the United States. I've laid out my workflow as follows:

  1. Download and unzip individual TIGER shape files from the Census Bureau (24 ESD, 19 SSD, 56 USD)
  2. Batch merge these 99 files together with ogr2ogr
  3. Convert merged shapefile to GeoJSON
  4. Convert GeoJSON to TopoJSON (ideally I would add state boundaries to the file here as well)

Step 4 is what is causing me problems, I am using the following batch script:

call topojson ^
    -o SDs11_Topo.json ^
    -p NAME ^
    --simplify-proportion .1 ^
    --id-property GEOID ^
    -- ^
    ESDs11.json ^
    SSDs11.json ^
    USDs11.json
pause

But I am presented with the following fatal memory error:

FATAL ERROR: CALL_AND_RETRY_0 Allocation failed - process out of memory

This has left me at a bit of a loss on how to continue, I would appreciate if someone could advise on a better workflow or ways to better manage memory when converting to topojson. Thank you.

È stato utile?

Soluzione

Use node --max_old_space_size=999 topojson.js ... to increase the memory available to node.js.

If you're using node.js binaries, you'll want the 64-bit binaries. The 32-bit ones are restricted to 1GB. https://code.google.com/p/v8/issues/detail?id=847

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top