node-gdal-async icon indicating copy to clipboard operation
node-gdal-async copied to clipboard

Way to make ogr2ogr available in path?

Open lucasprograms opened this issue 3 years ago • 3 comments

Hi, and thank you so much for this library!

I am dealing with datasets that I cannot bring into memory all at once, and to my understanding methods like vectorTranslateAsync need the data to be provided as a dataset in memory.

I am wondering if there is a way to leverage this library to expose ogr2ogr in path. I would like to execute some function like

spawn('ogr2ogr', ogrArgs)

is that possible using this library? If not, is there a way to use this library to process data with ogr without bringing the full dataset into memory?

lucasprograms avatar Mar 12 '22 20:03 lucasprograms

Normally everything ogr2ogr does should be matched by vectorTranslateAsync as both use the same C++ code.

Which driver are you using and what is the transformation you are doing?

mmomtchev avatar Mar 12 '22 21:03 mmomtchev

Basically it is any variety of common geospatial formats (shp, kmz, gpkg, etc.) to geojson. I haven't tried kmz or gpkg but it looks like gdal.open / gdal.openAsync does that automatically for shapefiles. Is there a way to do that transformation without storing the output in memory?

Also, I am happy to close this and move over to stack overflow or gis stack exchange if you'd rather deal with this sort of question there!

lucasprograms avatar Mar 12 '22 21:03 lucasprograms

GeoJSON has an excessive memory problem usage for sure - that is why GeoJSONSeq exists.

Is there a concrete ogr2ogr command with which you get higher memory usage in gdal-async than GDAL CLI?

mmomtchev avatar Mar 13 '22 08:03 mmomtchev