[gdal-dev] Is using geometry in SQL inside VRT supported?

Jukka Rahkonen jukka.rahkonen at mmmtike.fi
Fri May 24 08:39:08 PDT 2013


This works with ogrinfo
ogrinfo -ro cities.shp  -dialect SQLITE -sql "select GEOMETRY from cities"

I tried to make a VRT file which would do the same 

<OGRVRTLayer name="cities">
<SrcSQL>SELECT GEOMETRY from cities</SrcSQL>

Now ogrinfo does not find geometries

ogrinfo cities.vrt
INFO: Open of `cities.vrt'
      using driver `VRT' successful.
1: citiesERROR 1: SQL Expression Parsing Error: syntax error
ERROR 1: SQL statement failed, or returned no layer result:
"SELECT GEOMETRY from cities"

This exact use case is not at all interesting but there would be quite nice
possibilities if Spatialite SQL queries could be fired from the VRT and all
this would be supported for on-the-fly conversions

-Jukka Rahkonen-

More information about the gdal-dev mailing list