SQL-Spatial Analysis
This is probably something that would require GIS/ARCGIS type tools, but I'm wondering if any of you have any ideas on how I may be able to accomplish something just using MS SQL Server 2005.
I've created queries before that determine the distance between 2 points based on the latitude and longitude of both points (and a number of calculations).
However, consider this:
Say you have a table called Addresses that has a record with a latitude and longitude. It also has a polygonid (id generated from the map database that represents a polygon comprised of various points/vertices on a map each with their own latitudes and longitudes).
Now, if I wanted to see if the record with the latitude, longitude and polygonid was within the space of an actual polygon (comprised of various points/vertices on a map each with their own lats and longs), is there a way to accomplish this using sql?
I guess the issue is that the polygon itself from the map database is made of hundreds of points on a map (hence, hundreds of records on per polygon). So how does one compare to see if the point from the Addresses table is within the polygon from the Maps database?
In laymen's terms, how do I find if the point from one record in one table is within the area of a polygon from a map table?
I know I'm not providing sample data, I apologize, just not sure how I would present it.
As always, thanks!
Craig
Flam, February 12th, 2010 10:00 PM
Bookmarks