I'm developing a project using PostGIS to hold spatial data where I have records that hold geometry point data and records that hold geometry area data. To solve my problem I'm looking for two queries that can take geographic shapes rather than geometric shapes as parameters.

For query A I need it to return all points that intersect with a given area.

For query B I need it to return all areas that intersect with a given point.


ST_Intersects works for both Geography and Geometry data types so there should be no problem at all.

FROM my_pts JOIN my_areas
ON ST_Intersects(my_pts.the_geog,my_areas.the_geog)
| improve this answer | |
  • According to your link, ST_Intersects returns a boolean, not actual points of intersection, so this question hasn't been answered. – user10201 Sep 13 '12 at 19:01
  • 1
    @osdev ForeignerBR mentions that he wants to select existing points within an area so it is not necessary to calculate intersection points. The question therefore is answered. – underdark Sep 14 '12 at 6:33

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.