[gdal-dev] gdal.FileFromMemBuffer

Frank Warmerdam warmerdam at pobox.com
Mon Feb 23 12:21:49 PST 2015


Patrick,

After the FileFromMemBuffer() call, the content has been copied to an
internal buffer.  I think the C++ API has a way of avoiding the copy (if
desired) but the python does not.

The good thing is, no need to worry about the lifetime of the request
result object.

Best regards,
Frank


On Mon, Feb 23, 2015 at 12:12 PM, Patrick Young <
patrick.mckendree.young at gmail.com> wrote:

> Hi all,
>
> I've been playing around a bit with the vsimem stuff in gdal using python,
> works great!  Basically, I'm getting a json response from an ArcServer
> endpoint and I want to get out of the ESRI world as quick as I can.
>
> My question is, when I do something like this,
>
> r = requests.get(url, params=payload, timeout=timeout)
> gdal.FileFromMemBuffer('/vsimem/temp', r.content)
>
> does the buffer get copied to the created virtual file?  I know I need to
> clean up with a gdal.Unlink(('/vsimem/temp'), but does something bad happen
> when Python frees the r request?
>
> Thanks a ton!
> -Patrick
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>



-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam,
warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Software Developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20150223/35355c0b/attachment.html>


More information about the gdal-dev mailing list