map excel data

6
MapExcelData.XLS by ProcessTrends.Com and http://earth.google.com/ Introduction to Google Earth (GE) and Excel Google Earth is a powerful and free mapping tool that lets users zoom into any location on earth. Here's a zoomed view of 1600 Pennsylvania Ave., Washington DC. Google Earth (GE) is free, just download it here . Go here for free tutorials and advice on how to use GE. Mapping Excel Data in GE GE uses latitude and longitude coordinates to map locations on earth. This workbook demonstrates how to get the latitude and longitude of Excel address locations. GE uses Keyhole Markup Language (KML) files to import data into GE for display as overlays to the basemap.. KML files are similar to XML type files, specialized for map display. Excel users can display Excel based data points in GE by creating a KML file with VBA and opening that file in GE. Here's an example of a map of the USA showing the major IT companies: Microsoft, Google and Yahoo. I've included JuiceAnalytics because this workbook uses their geocoding VBA code. This workbook includes VBA code prepared by JuiceAnalytics.Com and A Simon. See Acknowledgements sheet for details. The Configuration Steps sheet explains what you need to do to develop this

Upload: ibrahim-ahmad

Post on 23-Nov-2014

1.054 views

Category:

Documents


48 download

TRANSCRIPT

Page 1: Map Excel Data

MapExcelData.XLS by ProcessTrends.Com

and

http://earth.google.com/

Introduction to Google Earth (GE) and Excel

Google Earth is a powerful and free mapping tool that lets users zoom into any location on earth.

Here's a zoomed view of 1600 Pennsylvania Ave., Washington DC.

Google Earth (GE) is free, just download it here. Go here for free tutorials and advice on how to use GE.

Mapping Excel Data in GE

GE uses latitude and longitude coordinates to map locations on earth. This workbook demonstrates how to get the latitude and longitude of Excel address locations.

GE uses Keyhole Markup Language (KML) files to import data into GE for display as overlays to the basemap.. KML files are similar to XML type files, specialized for map display. Excel users can display Excel based data points in GE by creating a KML file with VBA and opening that file in GE.

Here's an example of a map of the USA showing the major IT companies: Microsoft, Google and Yahoo. I've included JuiceAnalytics because this workbook uses their geocoding VBA code.

This workbook includes VBA code prepared by JuiceAnalytics.Com and A Simon. See Acknowledgements sheet for details.

The Configuration Steps sheet explains what you need to do to develop this capability on your desktop. You must register with Yahoo to be able to geocode addresses and obtain a working version of Google Earth to be able to run this demo on your desktop.

Page 2: Map Excel Data

Original Excel2KML.XLS Created by simon_a: http://earth.google.com/index.htmlhttp://bbs.keyhole.com/ubb/showprofile.php?User=105548 Google Earth Link Excel Geocoding Tool v2 - Juice Analytics

Acknowledgements

MapExcelData.Xls uses two web based tools and two Excel - VBA tools.

The web based tools are Yahoo's geocoding service to assign latitude and longitude to addresses and Google Earth to map Excel locations.

The two Excel VBA tools were prepared by A Simon and JuiceAnalytics. MapExcelData.Xls combines VBA code from JuiceAnalytics Geocoding tool.Xls and KML file generation code from A Simon's Excel2KML.Xls

Simon's and JuiceAnalytics' VBA code has been incorporated into MapExcelData.XLS and modified by ProcessTrends.Com, Oct., 2007 to provide both geocoding capability (assign latitude and longitude based on address) and production of KML files.

JuiceAnalytics VBA code is determines the latitude and longitude for locations given location as street address, street intersection or Zip code.

A Simon's Excel2KML.XLS VBA code is used to KML files by using File_Details worksheet KML code fragments. Simon's VBA code processes the source data file with latitude and longitude and builds a KML file using the KML fragments from File_Details.

Page 3: Map Excel Data

Configuration Steps - What you need to make Google Earth Maps with Excel Data

Necessary Software and Registration1. Download Google Earth - free from Google2. Registered Yahoo User - needed to get latitude and longitude for each address. Free, need to register

Geocode ConfigurationComplete the Geocode Configuration sheet fields: Geocode Tool Yahoo User ID Location of GoogleEarth.exe

KML Details Enter output File path and Name Enter Document Name

Page 4: Map Excel Data

Settings BeepOn ='Settings and Instructions'!$C$18GeocoderPassword ='Settings and Instructions'!$C$12

Geocoder to use: Yahoo GeocoderToUse ='Settings and Instructions'!$C$4Yahoo or geocoder.us GeocoderUsername ='Settings and Instructions'!$C$11

GoogleEarthExecutableLocation ='Settings and Instructions'!$C$15

Yahoo Id dkod_02703 YahooId ='Settings and Instructions'!$C$7

Geocoder.us Username:Geocoder.us Password:

Location of googleearth.exe: C:\Program Files\Google\Google Earth\googleearth.exe

Beep? 0if true, will beep every time an address is geocoded

Instructions

To get access to the Yahoo geocoding API, go to: http://api.search.yahoo.com/webservices/register_application

More info on the Yahoo geocoding API is available here: http://developer.yahoo.net/maps/rest/V1/geocode.html

To get a geocoder.us username and password go to: http://geocoder.us/user/signup

optional, to get Google Earth, go to http://earth.google.com

Macros must be turned on to use this tool. To enable macros, go to the Tools, Macro, Security menu and change the security level to Medium. Then close and reopen this spreadsheet. When the spreadsheet opens, select "Enable Macros". You can test to see if macros are working by clicking on the button to the right. If macros are working, you will see a message. If not, nothing will happen.

Fill in the location of the googleearth.exe and your geocoder.us username and password.

Enter addresses that you want to geocode in the Street, City, State, Zip columns on the Geocode page. Not all fields must be entered, but there must be a valid address and city+state or zip for geocoding to be performed.

Select the rows that you want to geocode. You don't have to select the entire row, any cell in the row will do. Click the geocode selected rows button to start geocoding. About 2-3 rows are geocoded each second, depending on the speed of your Internet connection.

If an address is not found, it may be because of a misspelling in the street address or city. To try again, fix the misspelling, then delete the "not found" values and geocode the row again.

At any time you can see the geocoded addresses in Google Earth by clicking the "View in Google Earth" button. This will save all the geocoded addresses to a Google Earth "KML" file and open the file in Google Earth. The file will appear in the Temporary Places folder.

Geocode Configuaration As Developed by JuiceAnalytics.Com

Page 5: Map Excel Data

KML Details As Developed by A Simon

Filepath C:\Data\google_Earth\kml_IT_co.kmlDocument name KML File of Major IT Companies

Footer

Style

Placemark code fragment style

File HeaderCode fragment 1

<?xml version="1.0" encoding="UTF-8"?><kml xmlns="http://earth.google.com/kml/2.1"><Document> <name>

File HeaderCode fragment 2

</name>

PlacemarkCode fragment 1

<Placemark> <name>

PlacemarkCode fragment 2

<Point> <coordinates>

PlacemarkCode fragment 3

,0</coordinates> </Point> <description><![CDATA[

PlacemarkCode fragment 4

]]></description> </Placemark>

</Document></kml>

<Style id="a"><IconStyle><Icon><href>http://maps.google.com/mapfiles/ms/icons/red-dot.png</href></Icon></IconStyle></Style>

</name><styleUrl>#a</styleUrl>

B C

1

234

5

6

7

8

9

10

11

12

13

14

15

16

171819

Page 6: Map Excel Data

Latitude Longitude Precision Address City State Zip Name Description

38.96729 -77.38042 address 555 grove street herndon va 20170 Juice Analytics Great data analysis site.37.4164 -122.0251 address 701 first ave sunnyvale ca 94089 Yahoo Good address matching service.

37.42319 -122.086 address 1600 amphitheatre parkwmountain vie ca 94043 Google Home of Google Earth47.64373 -122.1305 street One Microsoft Way Redmond Wa 98052-6399 Microsoft Corp Home of Excel41.13252 -73.70435 city 1 New Orchard Road Armonk NY 10504 IBM The granddady of computer technology

Step 1: Geocode Determine Lattitude & Longitude:

Select Rows, Press Geocode Button

Step 2: Generate KML File Update File_Details Sheet:Press Gen KML File Button

Step 3: View Map in Google Earth:

Press Run Google Earth Button