[gdal-dev] Executing a query getting null layer

Ahmed Tolba Ahmed.Tolba at schiebel.net
Thu Mar 23 01:33:51 PDT 2017


What I'm trying to achieve is to check if 4 points is contained inside the polygon, so I'm doing currently that query with SQLite dialect: 
I'm not sure if its correct or no, I have tried it, but it seems its working, I don't have enough data to test it out, so would you check the query please ?

string query = "SELECT * from areas WHERE st_contains(ST_BuildArea(areas.GEOMETRY),ST_ConvexHull(ST_GeomFromText('MULTIPOINT(16.17951 47.85549, 16.17951 47.85549, 16.17951 47.85549, 16.17951 47.85549)',4326)));";

Thanks 

Ahmed


-----Original Message-----
From: gdal-dev [mailto:gdal-dev-bounces at lists.osgeo.org] On Behalf Of jratike80
Sent: Wednesday, March 22, 2017 9:13 PM
To: gdal-dev at lists.osgeo.org
Subject: Re: [gdal-dev] Executing a query getting null layer

andreahmed wrote
> I'm using WFS-T. Does ogrinfo support that ? Can you show me the full 
> syntax please. I'm beginner in that topic.

Ok. A few mails ago you wrote "My data is in mapserver database which is PostGres PostGIS. What's the equivalent function for st_linefrommultipoint?"
which made Even and I to provide you advice for PostGIS. So we must take a few steps back because native PostGIS queries cannot be user for WFS datasource.

Your initial problem was perhaps how to convert four corner points into a polygon. There are probably many options but with SQLite dialect I would try ST_ConvexHull

select ST_AsText(
ST_ConvexHull(ST_GeomFromText('MULTIPOINT(0 0, 0 1, 1 1, 1 0)')))

-Jukka Rahkonen-








--
View this message in context: http://osgeo-org.1560.x6.nabble.com/gdal-dev-Executing-a-query-getting-null-layer-tp5313639p5313720.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
_______________________________________________
gdal-dev mailing list
gdal-dev at lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


More information about the gdal-dev mailing list