brownag / gpkg

Utilities for the Open Geospatial Consortium (OGC) 'GeoPackage' Format in R
http://humus.rocks/gpkg/
Creative Commons Zero v1.0 Universal
17 stars 0 forks source link

Transfer OGR sources incrementally that are too large to fit in memory #17

Open brownag opened 4 months ago

brownag commented 4 months ago

[...] it may sometimes be desirable to transfer between OGR sources without reading them into memory. Minimal support for querying and writing a SpatVectorProxy for an arbitrary source was added in https://github.com/brownag/gpkg/commit/8f3cae479dec4d0f8166ab51926893fe3b4658f0... but a more general solution would use an ogr2ogr-like interface, rather than going through a SpatVector/R intermediate object.

Originally posted by @brownag in https://github.com/brownag/gpkg/issues/15#issuecomment-1953052780

brownag commented 4 months ago

To clarify--this may require incremental reading into memory--but the key goal is that sources that are too large to fit in memory will not be read in their entirety, but rather read/write in chunks.

brownag commented 4 months ago

An alternative to hand rolling an approach for this would be to use gdalraster::ogr2ogr()--a new feature in current development (1.9.0.9070) version--which should be able to do exactly what this issue calls for; related to #19