[gdal-dev] .NET and OGR writing to stream

Even Rouault even.rouault at mines-paris.org
Wed Aug 3 08:38:13 EDT 2011


Selon Maksim Sestic <max at geoinova.com>:

> Hi Tamas,
>
>
>
> I don't know how to apply the same principle onto OGR drivers (not GDAL).
> I'm trying to create GML structure in memory using OGR driver, then handle
> resulting XML string further. Don't want to write dataset to a file, then
> read the file back to a string.

With the OGR GML driver, you can write to /vsimem/some.gml for example. And then
you should be able to read that in-memory file with gdal.VSIFOpenL() and read
its content with gdal.VSIFReadL(). However I'm not sure that the C# bindings
have been updated to support those VSIF*L functions.

There are examples of you to use those API in Python there :
http://trac.osgeo.org/gdal/browser/trunk/autotest/gcore/rfc30.py .

The C# version should be close (provided that the bindings exist for it of
course)

>
>
>
> Regards,
>
> Maksim Sestic
>
>
>
>   _____
>
> From: Tamas Szekeres [mailto:szekerest at gmail.com]
> Sent: Monday, August 01, 2011 13:05
> To: Maksim Sestic
> Cc: gdal-dev at lists.osgeo.org
> Subject: Re: [gdal-dev] .NET and OGR writing to stream
>
>
>
> Maksim,
>
> You can refer to the example
> http://trac.osgeo.org/gdal/browser/trunk/gdal/swig/csharp/apps/GDALRead.cs
> to see how to read data into a byte array and then you can write this array
> directly to the memory stream.
>
> Best regards,
>
> Tamas
>
>
>
>
> 2011/7/31 Maksim Sestic <max at geoinova.com>
>
> Hi all,
>
>
>
> Is there any example of OGR driver writing to memory stream (instead of file
> stream), in .NET?
>
>
>
> Regards,
>
> Maksim Sestic
>
>
>
> __________ Information from ESET NOD32 Antivirus, version of virus signature
> database 6338 (20110731) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
>
>
>




More information about the gdal-dev mailing list