[gdal-dev] Executing a query getting null layer

Even Rouault even.rouault at spatialys.com
Wed Mar 22 06:29:40 PDT 2017


On mercredi 22 mars 2017 13:12:14 CET Ahmed Tolba wrote:
> Hi All,
> I'm trying to execute that query
> string query = "SELECT *FROM areas WHERE
> st_contains(st_polygon(st_addpoint(st_linefrommultipoint(areas.geom),st_sta
> rtpoint(st_linefrommultipoint(areas.geom)),-1),st_srid(areas.geom)),st_mpoin
> tfromtext('MULTIPOINT(16.17951 47.85549, 16.17951 47.85549, 16.17951
> 47.85549, 16.17951 47.85549)',4326));";
> 
> but I get a null layer,
> 
> here is how I'm executing the query:
> OGRLayer * layer = m_wfs_t->ExecuteSQL(query.c_str(), NULL, "OGRSQL");

You are using ST_ functions, which are only provided through Spatialite. So replace 
"OGRSQL" with "SQLite".


-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170322/7afb81fb/attachment.html>


More information about the gdal-dev mailing list