title: In PostGIS, how do I find all points within a polygon?
body: <p>I am using PostgreSQL with the GIS extension to store map data, together with OpenLayers, GeoServer etc. Given a polygon, e.g. of a neighborhood, I need to find all LAT/LONG points stored in some table (e.g. traffic lights, restaurants) that are within the polygon. Alternatively given a set of polygons I would like to find the set of points within each polygon (like a GROUP BY query, rather then iterating over each polygon).</p>
  
  <p>Are these functions something I need to program, or is the functionality available (as extended SQL)? Please elaborate.</p>
  
  <p>Also for the simple 2D data I have do I actually need the GIS extension (GPL license is a limitation) or will PostgreSQL suffice?</p>
  
  <p>Thanks!</p>