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

John Cartwright John.C.Cartwright at noaa.gov
Tue Oct 26 12:19:44 EDT 2010


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



More information about the gdal-dev mailing list