You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I'm trying to convert US Zip Code Shapefile data to GeoJSON. My short script is below:
// ./index.jsconstogr2ogr=require('ogr2ogr').defaultconstfs=require('fs');(async()=>{let{ stream }=awaitogr2ogr('./input/tl_2022_us_zcta520 - most current available zip code shape files.zip');let{ text }=awaitogr2ogr(stream,{format: 'GeoJSON',maxBuffer: 1024*1024*1024*1024});fs.writeFile('./output/zipcodes.json',text,(err)=>{if(err)throwerr;console.log('The file has been saved!');});})();
Simple enough. I'm trying to convert a ~500MB file. I've adjusted the maxBuffer to have 1GB of buffer space, but I still get the following error when running:
$nodeindex.js
node:internal/errors:490ErrorCaptureStackTrace(err);^RangeError[ERR_CHILD_PROCESS_STDIO_MAXBUFFER]: stdoutmaxBufferlengthexceededatnewNodeError(node:internal/errors:399:5)atSocket.onChildStdout(node:child_process:487:14)atSocket.emit(node:events:512:28)ataddChunk(node:internal/streams/readable:324:12)atreadableAddChunk(node:internal/streams/readable:293:11)atReadable.push(node:internal/streams/readable:234:10)atPipe.onStreamRead(node:internal/stream_base_commons:190:23){code: 'ERR_CHILD_PROCESS_STDIO_MAXBUFFER',cmd: 'ogr2ogr -f GeoJSON -skipfailures /vsistdout/ /vsizip/./input/tl_2022_us_zcta520 - most current available zip code shape files.zip'}Node.jsv19.8.1
Any ideas? It doesn't look like the actual CMD is receiving any flags about the altered buffer size...
The text was updated successfully, but these errors were encountered:
The first command doesn't specify any buffer size and is unneeded it looks like, try running this:
// ./index.jsconstogr2ogr=require('ogr2ogr').defaultconstfs=require('fs');(async()=>{let{ text }=awaitogr2ogr('./input/tl_2022_us_zcta520 - most current available zip code shape files.zip',{format: 'GeoJSON',maxBuffer: 1024*1024*1024*1024});fs.writeFile('./output/zipcodes.json',text,(err)=>{if(err)throwerr;console.log('The file has been saved!');});})();
Hi! I'm trying to convert US Zip Code Shapefile data to GeoJSON. My short script is below:
Simple enough. I'm trying to convert a ~500MB file. I've adjusted the maxBuffer to have 1GB of buffer space, but I still get the following error when running:
Any ideas? It doesn't look like the actual
CMD
is receiving any flags about the altered buffer size...The text was updated successfully, but these errors were encountered: