title: Searching a database of coordinate-bound data for an arbitrary polygonal area
body: <p>I have a relational database where each entry is marked as a dot with latitude/longitude coordinates. I give the user the ability to mark an arbitrary polygon on a map, and want to return all entries that are within the polygonal shape.</p>
  
  <p>What would be the best way to achieve this? </p>
  
  <p>Also, it might be worth to point out that small errors are ok (ie. if there is an effective way to turn the polygon into a set of rectangles, then that is fine).</p>