|
Posted by rcamarda on 05/03/06 00:36
Hello,
I read an article on how to use Yahoos API to GeoCode addresses. Based
on the article I created a stored procedure that is used as follows:
SPGeocode '2121 15st north' ,'arlington' ,'va' ,'warehouse-test'
Returns:
Latitude Longitude GeoCodedCity GeoCodedState GeoCodedCountry
Precision Warning
----------- ---------- ------------- ------------- ---------------
--------------- --------
38.889538 -77.08461 ARLINGTON VA US
Precision Good No Error
It returns Latitude and Longitude and other information. Works great.
In conjunction with Haversine formula, I can compute the distance
between two locations if I know the Lat and Long of the two points.
This can start to answer questions like "How many students do we have
within a 10 mile radius of Location X?"
(Marketing should go nuts over this :)
My question is how can i use my data from a table and pass it to the
SPGeocode via a select statement?
The table I would use is:
CREATE TABLE "dbo"."D_BI_Student"
(
"STUDENT_ADDRESS1" VARCHAR(50) NULL,
"STUDENT_ADDRESS2" VARCHAR(50) NULL,
"STUDENT_CITY" VARCHAR(50) NULL,
"STUDENT_STATE" VARCHAR(10) NULL,
"STUDENT_ZIP" VARCHAR(10) NULL
)
;
This is so new to me, I am not even sure what to search.
TIA
Rob
Navigation:
[Reply to this message]
|