[gdal-dev] problem with the OGR VRT example?

Even Rouault even.rouault at mines-paris.org
Tue Oct 26 13:24:28 EDT 2010


Works for me (tested with 1.7.2, but there's no reason 1.7.1 doesn't work). 
Check that <OGRVRTDataSource> is on the first line of the test.vrt file without 
any extra character (space, newline, etc...) before.

Le mardi 26 octobre 2010 18:19:44, John Cartwright a écrit :
> Hello All,
> 
> I was looking at the OGR VRT example on
> http://www.gdal.org/ogr/drv_csv.html, and it doesn't seem to work -
> complains that unrecognized driver.  Am I missing something?
> 
> Following example on http://www.gdal.org/ogr/drv_csv.html,
> 
> 1) created a text file (test.csv) with the following:
> 
> Latitude,Longitude,Name
> 48.1,0.25,"First point"
> 49.2,1.1,"Second point"
> 47.5,0.75,"Third point"
> 
> 2) created a text file (test.vrt) with the following:
> 
> <OGRVRTDataSource>
>     <OGRVRTLayer name="test">
>         <SrcDataSource>test.csv</SrcDataSource>
>         <GeometryType>wkbPoint</GeometryType>
>         <LayerSRS>WGS84</LayerSRS>
>         <GeometryField encoding="PointFromColumns" x="Longitude"
> y="Latitude"/> </OGRVRTLayer>
> </OGRVRTDataSource>
> 
> 3) tried "ogrinfo -ro -al test.vrt" and got:
> 
> FAILURE:
> Unable to open datasource `test.vrt' with the following drivers.
> 
> 
> This is GDAL 1.7.1 on linux.  My ultimate objective is that take a CSV
> file whose first two fields are x,y and convert to a shapefile with the
> remaining fields as attributes.
> 
> Thanks!
> 
> --john
> 
> _______________________________________________
> 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