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 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.

share|improve this question

1 Answer 1

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

SELECT * 
FROM my_pts JOIN my_areas
ON ST_Intersects(my_pts.the_geog,my_areas.the_geog)
share|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
    
@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

 
discard

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

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