Section C.3. Step 2: Calculate Axis Values for the BusinessEntities Table


C.3. Step 2: Calculate Axis Values for the BusinessEntities Table

Now that you have your business listings available in the SQL table, run the following SQL query (either using the SQL Server Enterprise Manager or SQL Query Analyzer) to calculate the values for the columns XAxis, YAxis and ZAxis:

     UPDATE [BusinessEntity] SET XAxis = (cos(((4*((4*atn(1/5))-       (atn(1/239))))/180)*[ BusinessEntity].Latitude)*cos(((4*((4*atn(1/5))-       (atn(1/239))))/180)*[ BusinessEntity].Longitude));     UPDATE [BusinessEntity] SET YAxis = (cos(((4*((4*atn(1/5))-       (atn(1/239))))/180)*[ BusinessEntity].Latitude)*sin(((4*((4*atn(1/5))-       (atn(1/239))))/180)*[ BusinessEntity].Longitude));     UPDATE [BusinessEntity] SET ZAxis = (sin(((4*((4*atn(1/5))-       (atn(1/239))))/180)*[ BusinessEntity].Latitude));

This query creates the values for the XAxis, YAxis, and ZAxis columns in the table. Now your data is ready to be searched for spatial proximity queries.




Programming MapPoint in  .NET
Programming MapPoint in .NET
ISBN: 0596009062
EAN: 2147483647
Year: 2005
Pages: 136
Authors: Chandu Thota

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net