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.

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?

Best regards, Jann

share|improve this question

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.

    
What you want to do is called a spatial join. It's already covered in this question. How to perform a spatial join of point and polygon layers in PostGIS? –  R.K. Dec 3 '12 at 12:23

1 Answer 1

up vote 4 down vote accepted

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.

share|improve this answer

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