A View Inside My Head

Jason's Random Thoughts of Interest
posts - 71, comments - 168, trackbacks - 12

For Jeff: Spatial Querying

A quick sample of usage as requested by my friend Jeff McWherter:

Querying for all data in a table where the "zip code polygon" is within 20 miles of a geocode point (must convert 20 miles to meters in the predicate)::

select * 
from dbo.fe_2007_us_zcta500 
where Boundary.STDistance('POINT(-79.8884595930576 43.2609696686268)') < (20 * 1609.344) 

Print | posted on Wednesday, March 04, 2009 6:08 PM | Filed Under [ SQL Spatial ]

Feedback

Gravatar

# re: For Jeff: Spatial Querying

Thank you :)
3/5/2009 9:15 AM | Jeff McWherter
Comments have been closed on this topic.

Powered by: