Possible Duplicate:
How to perform a spatial join of point and polygon layers in PostGIS?

I don't know how to solve my actual problem.

I have polygons and points (some points are located in the polygons) and I want to add the polygon attributes to the points when they are inside the polygons.

Does anybody has an idea how to do this?

marked as duplicate by R.K., Simon, djq, Aaron, whuber Dec 3 '12 at 15:54

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


You can use the st_within statement. So something like:

select * from point p1, polygon p2 where st_within (p1.geom, p2.geom)

More information on the postgis website.

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