Page 1 of 2

MLS membership to Google Earth

Posted: Mon Jul 02, 2007 8:43 pm
by dostler-p40
Hi,

I'm new here so forgive me if this has already been posted(It didn't turn up on a search). Also it seems that those of you in the US have tools not available to the rest of the world so I don't know if you already have a nice membership map with your ward websites. I wrote a python script to convert the MLS exported csv to a format that can be imported into google earth or google maps.

If any one is interested here it is:
http://web.mac.com/davidostler/iWeb/PYTHON-iWeb/mls2GoogleEarth.py

Usage: python mls2GoogleEarth.py Membership.csv

Membership.csv being the csv export from MLS.

This creates a file called wardMap.kml that you can import into Google Earth

I've created this based on the way we format addresses down here in New Zealand. I've tried to revamp the script to work with US addresses but I can't test it because I don't have data to test it with.

If anything is amiss it should be easy to fix by editing the script values for city and state.

The script also produces a csv file with the ward info reformatted to work better with address book imports. This file also contains the latitude and longitude for each member. If you run the script again from the same directory containing this file it will pull the coordinates from here instead of accessing Google.

Further it will write out an error file called geoError.txt containing a list of addresses that google could not find. You can use this to identify errors in the MLS information.

Hope you find this useful.

Posted: Mon Jul 02, 2007 9:09 pm
by thedqs
Thanks for the post and the code, there have been a few but it is always interesting to see what solutions other people have come up with.

Posted: Tue Jul 03, 2007 12:25 pm
by WelchTC
Very cool script! Nice work!

Tom

Proxy

Posted: Tue Jul 03, 2007 3:25 pm
by dostler-p40
I tried this script for the first time on the ward computer and it failed. I'm guessing that there is a proxy server on ward computers. I haven't had time to trouble shoot but if this is the case adding the following line to the script or adding to the system variables should fix it.

http_proxy=http://www.myproxy.com:3128

Go Kiwi's!

Posted: Sat Sep 01, 2007 3:18 am
by fraserredmond
Nice work dostler - being in python makes it a little less accessable, I'm thinking of having a go at porting to javascript, any objections? (Have you already done it yourself?)

BTW, In your source code, it has a typo of cvs instead of csv and you left "Wellington Ward" in the Name attribute of the KML file header...

Posted: Sun Sep 02, 2007 3:13 pm
by dostler-p40
redzarf wrote:Nice work dostler - being in python makes it a little less accessable, I'm thinking of having a go at porting to javascript, any objections? (Have you already done it yourself?)

BTW, In your source code, it has a typo of cvs instead of csv and you left "Wellington Ward" in the Name attribute of the KML file header...


Please by all means write a javaScript version. I haven't written a java script equivalent.

Posted: Mon Sep 03, 2007 2:13 pm
by james_francisco
Very nice. My only issue is that Google Earth and Google maps don't update very often. Right now MSN maps has the best data for my stake area southeast of Phoenix.

James Francisco

Posted: Mon Sep 03, 2007 4:23 pm
by JamesAnderson
I noticed you were from Arizona. That is where Google Maps may have messed up recently.

They updated them, and the satellite images that go with them, but they are more than nine months old. You'll be able to tell if you look at where the light rail line is, and the stage of construction that was in at that time is when they got the pictures. Ditto for the 202 Freeway where it goes through the satellite images, you'll see the stage between Power and University plus the (then) unopened segment from the SuperRedTan stack interchange to University as it was at the time too.

That last one may not have even been updated either, I understand some of East Mesa did not get in the final shot they used for the present mapping of the Phoenix area. And therein lies the problem with Google Maps, especially in fast growing areas like Phoenix.

Posted: Tue Sep 04, 2007 1:13 am
by james_francisco
In the part of Pinal county where I live, the Google earth satellite pictures are at least two years old. Yahoo maps are at least two and a half to three years old. MSN maps are at most one year old for our area,

Posted: Tue Sep 04, 2007 9:48 am
by thedqs
Does anyone know the update schedule for the maps? I just thought that google/msn/yahoo just got the images from other satellite image providers and they just updated them like one a month. It might be that they have different providers though.