[gdal-dev] OGR and GML?

Frank Warmerdam warmerdam at p...
Tue Jul 16 09:29:58 EDT 2002

Ben Discoe wrote:
> Is there a way to get OGR to parse from a memory buffer, rather than a disk
> file?
> Right now i am using the following, which assumes a filename:
> OGRDataSource *pDatasource = OGRSFDriverRegistrar::Open( filename );
> However, my GML files are being acquired using HTTP, as a big string buffer.
> I can write the buffer out to a temporary file, and point OGR to that, which
> works, but i hope there is a more efficient way?


There is currently no direct support for this, but it could be implemented.
Note that the GML parser is currently implemented on top of the Xerces C++
parser which has an abstracted class to represent the input source, and
implementation which can use a local file, memory buffer or URI as the source.

In your case would it be practical to pass in the URL and let the parser
pull the data instead of doing it yourself?

Hmm. Actually, since we make two passes this might be a bad idea. My second
thought is that we engineer some esoteric format for a "filename" that can
be used to refer to a memory buffer and then low down in the GML reader it
can recognise this and construct a memory reader.


"OGR_GML_MEM:<pointer-offset> <memory-block-size-in-bytes>"

Let me know if you would like me to incorporate this.

Best regards,

I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at p...
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent

More information about the Gdal-dev mailing list