[postgis-users] ST_Intersects ST_GeomFromGeoJSON syntax
joseph85750 at yahoo.com
Tue Jan 6 11:31:46 PST 2015
Hello,I currently have a select which works correctly:
$sth = $dbh->prepare("select ST_Asgeojson( geom ) from polys where ST_Intersects(ST_GeomFromText('POLYGON(($textPoly, $closingLon $closingLat))', 4269), geom)=TRUE");
I'm trying to do the same thing, using FromGeoJSON instead of Text. Below is my attempt, but it's not working. This is my statement, where $jsonPolys contains the JSON:
$sth = $dbh->prepare("select ST_Asgeojson( geom ) from polys where ST_Intersects(ST_GeomFromGeoJSON('POLYGON(($jsonPolys))', 4269), geom)=TRUE");
I think the problem has something to do with the POLYGON text, since it may not be necessary. But I can't get the syntax right.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the postgis-users