I have a table of boundaries as polygons and another table of peaks as points. I want to find the points that are within the polygons and the polygons are extended with a buffer. What would be the fastest way to do that?
At the moment I am trying to work with ST_Within which gives me good results, but adding ST_Buffer does not seem to work:
SELECT p.name, p.elev, a.name FROM eu_peaks p, eu_admin_valid a where
ST_Within(p.geom, ST_Buffer(a.the_geom, 0.02))
order by a.name;
Is this a good approach? What should I change?