feedback
Jul 6 2005

Google Maps (gmaps) :: DTS Church Search

by John Dyer

For my first use of the newly released Google Maps API, I hooked up our database of churches with Dallas Seminary grads. We've had a "Find a church" list for a while, but this is much more helpful. Try it out:

The one problem I ran into was the number of flags that could be placed on a page. Below is a picture of what a map looks like with > 300 icons placed on it. It took my P4 3.2 with 1GB RAM about 2 minutes to load the map. It seems that around 50 is about right for a speedy map. Here's a snapshot of the map with tons of churches on it:

Dallas Seminary Find a Church with Google Maps

PS. I relied on Google Maps for geocoding. I wrote some code to lookup the latitude/longitude data for all the church addresses. After doing this, I found out that it might be possible to use geocoder for retreiving this data.

Comments

Unresolvable July 6. 2005 00:56

John,



This site is simply incredible. I've been playing around with Google Maps for leisure and have to ask... How did you get the distance information? You are passing the radius and zip to another page, and getting back xml results, but how did you do it?



Thanks!

Unresolvable

Unresolvable July 6. 2005 01:26

Thanks for the compliments!



Google Maps works primarily with lat/long data instead of directly with addresses (<a href="http://mcmanus.typepad.com/grind/2005/06/why_the_yahoo_m.html">yahoo's map<a/> lets you use addresses directly). So if you want to use Google's API, you need to get lat/long info for all your addresses.



Next, you need to have lat/long data for all US zip codes. There are several pay databases available with this information, but I found one <a href="http://www.cfdynamics.com/zipbase/">free database</a> on <a href="http://www.codeproject.com/dotnet/zipcodemapping.asp">Code Project</a>.



When a user types in a zip code, the zip code's lat/long is looked up, then it is compared to the lat/long of all the addresses. You can calculate the distance in a few ways. You can just add the "radius" to the lat and long which makes a square. You can use a^2 + b^2 = c^2 to approximate the distance and get more of a circle (not totally accurate since the earth is a sphere). Or, you can actually use a lat/long distance formula, but it is harder to do a direct SQL query that way.



Hope that helps!



JD

Unresolvable

Unresolvable July 8. 2005 15:00

Check it out: All the churches in a 500 mile radius of my zip code with a Dallas Theological Seminary graduate as pastor. Well, sort of. It appears to be U.S. only, and I can tell you that most of Kansas, Missouri, Kentucky and farther south are definitely more than 500 miles away. But it's still cool. The DTS Church Search is a potential new feature for the DTS web site that they're currently testing. John Deyer blogged about setting it up and passed it along to us. It uses...

Unresolvable

Unresolvable July 8. 2005 17:55

Our little Google Maps experiment was featured on a few websites this week:



Google Maps Mania

...

Unresolvable

Unresolvable July 20. 2005 14:56

A few weeks ago I went a little crazy

with the new Google Maps API. I also hooked it up to some pictures...

Unresolvable

Unresolvable July 20. 2005 14:56

A few weeks ago I went a little crazy

with the new Google Maps API. I also hooked it up to some pictures...

Unresolvable

Unresolvable September 1. 2006 19:11

John, did you write this in vb.net? I'd love to see some source code.

Unresolvable

Add comment


(Will show your Gravatar icon)  

  Country flag

biuquote
  • Comment
  • Preview
Loading