[gdal-dev] Virtual Filesystem Question(s)

Even Rouault even.rouault at mines-paris.org
Sat Feb 9 15:19:29 PST 2013


Le samedi 09 février 2013 22:28:15, Stephen Woodbridge a écrit :
> Hi Even,
> 
> Frank pointed me to your blog entry on the GDAL virtual file system at:
> 
> http://erouault.blogspot.com/2012/05/new-gdal-virtual-file-system-to-read.h
> tml
> 
> This is most excellent. I am trying to get this to work using the
> /vsicurl/ option to connect to a php page that generates CSV output, But
> it is not sucessful :(

With GDAL 1.10dev and the new /vsicurl_streaming/, I managed to do it :

test.vrt:
<OGRVRTDataSource>
     <OGRVRTLayer name="test-pg">
         <SrcDataSource>CSV:/vsicurl_streaming/http://example.com/ws/test-
pg.php</SrcDataSource>
         <GeometryType>wkbPoint</GeometryType>
         <LayerSRS>WGS84</LayerSRS>
         <GeometryField encoding="PointFromColumns" x="x" y="y"/>
     </OGRVRTLayer>
</OGRVRTDataSource>

It is important that the VRT layer name is the php filename, because that's the 
layer name that the CSV driver will return.
And I've added CSV: prefix in front of SrcDataSource so that the the CSV driver 
knowns that it must open the file even if the extension is not CSV.

This being done, you can try : ogrinfo test.vrt -al -q -ro

I'll try to analyze the failure you got with /vsicurl/. With GDAL 1.10dev, I 
don't get an infinite loop, but it does get stuck in a curl call.

Even



More information about the gdal-dev mailing list