Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm trying to write a query in Postgis which will return all rows where a dynamically changing longitude/latitude point resides within the geometric polygon of that row (in the geom column). This is the query I'm trying to use:

SELECT * FROM "geospatial-data" WHERE ST_Contains("geospatial-data".geom,ST_Transform(ST_GeomFromText('POINT(-90.56210 38.60369)',4326), 4269))=true

I'm basing this query off of an older post here: http://codemagician.wordpress.com/2009/09/12/point-in-polygon-in-postgis/

I'm not getting any errors but I can't understand what I'm doing wrong. How should I write/modify the query in order to query for a point-in-polygon?

share|improve this question
    
that one return true when given point is in given geospatial-data geometry. so it work like intended –  simplexio Jun 17 '13 at 11:59
    
Really? I thought it will select everything where the "WHERE" condition is true. It shouldn't be returning true, instead, it should be returning the rows of data where the condition equals true. Or am I missing something? –  Glen Jun 17 '13 at 13:54
    
Well, it does return those rows (=true is not needed really). So if you're not getting data you want the problem is with data. –  Jakub Kania Jun 19 '13 at 12:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.