Geocoding
Almost all SQL Server databases already contain some form of spatial data - that is, information that describes a place on the earth. This may be a customer's address, the name of a town or region for which a sales manager is responsible, or the list of locations at which a delivery van is scheduled to make a delivery.
Geocoding is the process of taking this descriptive spatial information and using it to obtain a structured spatial representation (normally a Point instance) representing that feature, so that it may be used in spatial operations.
To demonstrate how geocoding works, try typing any address into the box below, and hit the Geocode! button. You'll receive the WKT syntax of a Point located at that address.
The example shown on this page uses the Google Maps geocoding service based on a single address typed into a webpage. However, in this chapter of the book, I'll show you how to create a new function that calls the Microsoft MapPoint Web Service geocoder directly from SQL Server, using syntax like this:
SELECT dbo.Geocode('1600 Amphitheatre Way, California')
By using a function such as this to automatically geocode existing address data, you can take advantage of any existing spatial data in your database and start performing spatial functions on them.


Comments
Post new comment