Radius Query

Posted on Monday, June 23, 2008 03:18 PM by K. Latham
I've been testing out some new ways to do a radius query with the historic places database at Meaning you pick a city and get back all the historic places listed within a given mile radius.

Examples: To make this work I had to find a list of Oklahoma zip codes with longitude and latitude to import into the database. I found a free one at Sourceforge: The Zip Code Database Project. Very handy. I'll be using it in other projects.

I also had to search around to learn how to query a longitude and latitude radius. I've bookmarked at some the references I found useful.

Not every Oklahoma community is listed. The reason is because not every community has a zip code. Many of the smaller Oklahoma communities have rural route addresses. Check out the Zip code pages in your Yellowbook (Feist). Just pick the closet city and increase the radius.

I purposely set searching between 5 and 50 miles. I did this to limit the amount of sites returned.

My hope is to someday have a way GPS enabled mobile devices (like the new iPhone) can show you the historic places near you.