Ryan Byrd dot net

LDS Temples of the World, Google Map Style

Regional Maps

UPDATE: I'm gathering the latitude and longitude of each LDS temple. That way I can plot them on a Google Map. If you have some of this information, go ahead and drop me an email.

UPDATE: I wrote a php screen scraper script to get the temple address information from ldschurchtemples.com, though I bet if I emailed that site's webmaster (Rick Satterfield) he would have given me a database dump. Oh well. I thought about harvesting the info from the lds.org's temple page as well, and I might do that in the future. The output of my screen scraper is temples.txt

UPDATE: Now I need to get latitude and longitude for each of the addresses. Google Earth does that, but I would hate to have to paste each address in separately. There has got to be a better way.

UPDATE: I know there is another LDS Temple map site (by Ryan Passey). I just wanted to do it with Google Maps.

UPDATE: I just found that Map o'rama provides lat and long for an address anywhere in the world. Let's start with a US address. I used the address for the Saint George Temple and was directed to this URL: http://www.maporama.com/share/map.asp?COUNTRYCODE=US&_XgoGCAddress=250+E+400+S&Zip=&State=UT&_XgoGCTownName [BREAK]
=St.+George&SEARCH_ADDRESS.x=25&SEARCH_ADDRESS.y=10&SEARCH_ADDRESS=submit

Breaking it down gives:

http://www.maporama.com/share/map.asp?
COUNTRYCODE=US
&_XgoGCAddress=250+E+400+S
&Zip=
&State=UT
&_XgoGCTownName=St.+George
&SEARCH_ADDRESS.x=25
&SEARCH_ADDRESS.y=10
&SEARCH_ADDRESS=submit
A quick view of the html source revealed the following code:

Lat-Long:</td><td rowspan="3"><img src="../images/pixel.gif" width="8"></td></tr><tr>
<td class="SearchMapFontText">376'  , -11334' </td></tr><tr>
<td class="SearchMapFontText">37.101 , -113.578</td></tr>

Through which I could parse to get:
latitude: 376' , -11334'
longitude: 37.101 , -113.578

Of course, Google Maps requires lat and long to be in decimal degrees, but that is a simple conversion.

So now I will divide out the US Temples and query maporama to get the latitude and longitude. That shouldn't take long.

I've just discovered that Microsoft has a map service that gives lat and long for US addresses

I just found a very cool service for US addresses: Stephen P. Morse's site.

UPDATE: Next I filtered the temples.txt file for United States addresses, creating another file (in csv format), templeus.txt.

Then I got an array of state abbreviation to state name, like
$convert["AL"] = "Alaska";
but I wanted the inverse:
$convert["Alaska"] = "AL";

so I used textpad, regular expression search and replace to search for
\$convert\["\([A-Z][A-Z]\)"\] = "\([^"]*\)";
and replace it with
$convert["\2"] = "\1";

Then it was time to fill out the maporama query string, query maporama, get the degree lat and long back, xml file like so:

<locations>
<location lat="41.305" lng="-95.964" text="Winter Quarters Nebraska Temple"/>
...
</locations>

that XML file is here

and the US temple map is here

I expected that I would get some errors. The Mesa Arizona temple didn't show up because maporama did not recognizer "101 s lesueur st" but only "101 s lesueur". I manually deleted the "st" suffix, reran the script and the temple showed up.

UPDATE: well my first xml generation got 50 us temples whereas my templesus.txt has 60. Add an xml entry for Mesa and we're still missing 9. Let's go find them. Fortunately, we can simply cut and past the templesus.txt and temples.xml file into an excel spreadsheet and visually spot the missing temples. Then we'll search through the output of the most recent php xml generation file to find the URLs (I printed them out.) Pasting those URLs into a browser will show us where maporama is confused.

In Internet Explorer I get a strange error with my google maps: "Internet Explorer cannot open the Internet site, Operation aborted"
The fix? (from members of Google Groups):
Enclose your JavaScript code into a function and then execute it through a body onload event.

function ShowMeTheMap()
{
 blah blah
 }
 
And then, in the body tag:
 
 <body onload="ShowMeTheMap();"> 
Google Map API Documentation

UPDATE: Feeling a little sheepish. Turns out that www.ldschurchtemples.com has the temple latitudes and longitudes on their driving directions pages. They even have a little google map. Dang it! I should have written a crawler to get that info.

Here's the text I'm looking for:

 var longitude = -111.631661;
var latitude = 39.273501;
on this example page: http://www.ldschurchtemples.com/cgi-bin/directions.cgi?manti&directions
I'd need to crawl this page: http://www.ldschurchtemples.com/directions.cgi

He doesn't seem to have google maps for international temples though.

He does have nifty little images of the temples in his popup ballons.

UPDATE: Like ldschurchtemples.com, I now have little thumbnail pics now inside the balloons. They are all the same temple image though. I need to get a bunch of temple pics and thumbnail them all.

UPDATE: I just wrote a script that obtained an image of each of the temples. Here's the list.

UPDATE: I just wrote a script that thumbnailed all the temple images. Here's the list of thumbnails. Now I need to find a way of associating my each temple to its thumbnail and creating an XML doc with the info.


Send to a friend * Print this page * Join the club * Talk with my robot * Advertise here * Search this Site * Donate * Link to me


Web hosting by Utah Hub *  Powered by CreativeTap *  In association with Segomo
Unless otherwise noted, Copyright 2004-2008, Ryan Byrd. All Rights Reserved.
Ryan Byrd dot net -- probably the coolest site in Utah