[Qgis-user] Unable to open OGR .vrt file

Even Rouault even.rouault at mines-paris.org
Mon Jun 16 15:50:24 PDT 2014


Le mardi 17 juin 2014 00:46:42, Andrea Acinelli a écrit :
> Operating System: OS X 10.9.3
> QGIS 2.2.0-9 distributed by KyngChaos
> Postgres 9.3.4 & PostGIS 2.1.2 distributed by Postgres.app
> 
> Hi,
> 
> When trying to open a .vrt file referencing a .csv with 'lat' and ‘ ong’ in
> two separate columns I get the following error message: ‘Invalid Data
> Source: /Users/Andrea/postgis_cookbook/Chapter 1/global_24h.vrt is not a
> valid or recognized data source’.
> 
> Virtual file and .csv file are in the same directory. I did my homework and
> tried to search for answers to similar questions in this mailing list, the
> QGIS User List and GIS StackExchange but could not find any. The following
> is the content of the .vrt file:
> 
> <OGRVRTDataSource>
>     <OGRVRTLayer name="Global_24h">
>         <SrcDataSource>Global_24h.csv</SrcDataSource>

Try:
          <SrcDataSource relativeToVRT="1">Global_24h.csv</SrcDataSource>

>         <GeometryType>wkbPoint</GeometryType>
>         <LayerSRS>EPSG:4326</LayerSRS>
>         <GeometryField encoding="PointFromColumns" x="longitude"
> y="latitude”/> </OGRVRTLayer>
> </OGRVRTDataSource>
> 
> NOTE: I’m able to read the file with the GDAL utility ogrinfo installed
> with PostGIS: $ ogrinfo global_24h.vrt Global_24h -fid 1

-- 
Geospatial professional services
http://even.rouault.free.fr/services.html



More information about the Qgis-user mailing list