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(
        ST_GeomFromText('POINT(-90.56210 38.60369)', 4326), 4269

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?

  • that one return true when given point is in given geospatial-data geometry. so it work like intended Jun 17, 2013 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 Selle
    Jun 17, 2013 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. Jun 19, 2013 at 12:39
  • you also might want to provide a link to your polygon data
    – clhenrick
    Apr 20, 2015 at 1:25
  • Perhaps the SRID of "geospatial-data" is not 4269 in your data.
    – user30184
    Apr 15, 2016 at 21:30

1 Answer 1


It works to me when i avoid the mismatch SRID's. SRID's must be identical

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.