[gdal-dev] using an in-memory file as -cutline argument in gdalwarp

Joaquim Manuel Freire Luís jluis at ualg.pt
Wed Mar 31 06:34:15 PDT 2021


I have low hopes on this one but have to confirm.

I have this "ds" dataset with one polygon geometry, which is correctly saved on disk with

ogr2ogr(ds, save="lixo.gmt")

and later correctly "cutlines" with

gdalwarp("IMG_9106.jpg", ["-cutline", "lixo.gmt", "-to", "SRC_METHOD=NO_GEOTRANSFORM"]);

but I wanted to avoid the step of saving to disk and instead using the inMemory file. If I ask its name, I see

GDALGetDescription(ds.ptr)
"/vsimem/##258"

But this fails

gdalwarp("IMG_9106.jpg", ["-cutline", GDALGetDescription(ds.ptr), "-to", "SRC_METHOD=NO_GEOTRANSFORM"])
NULL Dataset

Can this be made to work (would it work with the python bindings?) and I'm just doing it wrong or it just can't?

Thanks

Joaquim


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20210331/bffa027b/attachment.html>


More information about the gdal-dev mailing list