Google has a demo for Google Maps which allows you to draw a search area on a page as a free-form polygon, but given a set of entries in my SQL database (~25,000), how could I actually find out which entries are within this shape?
Google's demo: http://gmaps-samples.googlecode.com/svn/trunk/poly/mymapstoolbar.html
You can see this function in action here: http://www.rightmove.co.uk/draw-a-search.html
Maths is not my strong point, so I'm wondering if there is an easy way to do this (preferably at database level) or otherwise in C#?
Edit: The difficult part is doing it for latitude and longitude coordinates (eg, +40.689060, -74.044636) where both the data and the polygon points are in this format. I've found some samples for doing this on a simple x/y plane but doing this on WGS84 lat/long seems like it's going to be very tricky - yet several sites seem to do this! Any accepted answer would need to be for lat/long map coordinates as I know how to solve the problem for a simple x/y grid.
Thanks!