blankblank blank




Thematic Polygon Shapefile Display In Google Maps



There are a number of free ways to convert shapefiles to KML format for display in Google Earth, but fewer and less flexible shapefile display options for Google Maps. This site lets you upload small line and polygon shapefiles for display in Google Maps, but not in a permanent form, and with limited display options. This other site details a procedure to display polygon shapefiles in Google Maps, but it’s not particularly straightforward to implement. There’s also some direct support for displaying simple KML files in Google Maps, so you could always try converting the shapefiles to KML and then opening them in Google Maps. But there’s a Java application that makes the process reasonably straightforward for polygon shapefiles, shows the data already loaded in a Google Maps interface, and offers some added display options.

The Google Map Creator can be downloaded from the University College of London’s Centre for Advanced Spatial Analysis. The Windows version, which I’ll describe below, comes in installer format; there’s also a Java archive version that can be run in either Linux or Macintosh. Download and install the program in Windows; it will also install the Java Advanced Imaging Library.You will also need:1. A shapefile with an associated projection definition file (.prj). If your shapefile doesn’t have a .prj file, you can create one using the free GIS editor MapWindow. Open MapWindow, select GIS Tools => Vector => Assign Projection To Shapefile, and follow the straightforward process of selecting your shapefile and its coordinate system to create a .prj file. The shapefile doesn’t have to be in latitude/longitude/WGS84, unless Google Map Creator has problems re-projecting the data into the correct coordinate system, and it will tell you that.

2. A thematic variable you can plot that is numeric in nature - Google Map Creator doesn’t handle alphabetic variables yet. For small ranges of alphabetic variable, you could open the DBF file in OpenOffice, make a copy of that column, and replace the alphabetic variables with discrete numeric values, but with larger numbers of alphabetic variables this can become very tedious.

3. If you want to post the map you create on the web, you’ll need a free Google Map API key. If you’re only going to use the map on a local computer, a key isn’t needed.

Start up the program, and use File => Open to load your shapefile (in this case, rainfall across the US; click on the picture to view a larger version of the image):

Google Map Creator interface for plotting shapefile data in Google Maps

From the drop-down menu at the top, select the shapefile variable to use as the plotting theme, Range in this case. If you want to see the outlines of the shapefile polygons, click on the Outlines button at the top:

Google Map Creator interface for plotting shapefile data in Google Maps

To select the colors to plot the precipitation range by, click on the “Cols” button at the top:

Google Map Creator interface for plotting shapefile data in Google Maps

Click on Add to add another color; check the Select box and click Delete to delete a color. Double-click on a Value or Description to modify it. As you modify the values, they will automatically be sorted from low to high. Clicking once on a color bar brings up a palette that allows you to select a desired color. Selecting Discrete makes that color apply only to the specific value specified; selecting Transition makes the color for a value shade from one value to another. For example, with the following values entered, and Transition selected:

Google Map Creator interface for plotting shapefile data in Google Maps

the resulting map looks like this:

Google Map Creator interface for plotting shapefile data in Google Maps

where, for example, shades of orange represent values between red (10 inches and less) and yellow (25 inches).

At the left, you set the maximum permissible zoom level in the Google Maps interface. Higher zoom levels mean larger number of image tiles to be generated, stored, and served up. For example, a maximum zoom of 4 creates 16 tiles, while a maximum zoom of 8 will generate 1422 tiles.

Finally, select Edit => Page Data. Here you enter your Google API key if you have and need one, the minimum API version required (usually 2 is fine), and the title of the map:

alt=”Google Map Creator interface for plotting shapefile data in Google Maps”

Click on Create in the lower right-hand corner, then Start, and the image tiles and an HTML file needed to display the Google Maps interface will be created in the same directory that holds the original shapefile. The image tiles will be stored in a directory with the filename of the shapefile with “-tiles” appended; the HTML file will have the filename of the shapefile with an .html extension. There will also be a ucl75547A.gif file in the directory, the logo of University College of London. To view the newly-created Google Map with the shapefile thematic overlay, open the HTML file in your browser:

Google Map Creator generated web page with polygon shapefile data plotted in Google Maps interface

The map key at the upper-right includes the range descriptions entered above. Below the map key are buttons that let you set the transparency of the thematic overlay. “Map” sets the transparency at 100% (no overlay visible), “Data” sets the transparency at 0% (fully opaque), and the fraction buttons set transparency in between those values; the map above is shown at “1/2″ transparency.

If you’ve entered a valid Google Map API key into the Page Data, you can now upload the HTML files and image tile directory to the web server of your choice for public Internet access to your map.

Other posts in the Google Maps Tools series

  1. Coordinate Data From Google Maps
  2. Reverse Address Geocoding With Google Maps
  3. Converting Google Maps Search Results To GPX
  4. Coordinate, Elevation, Distance And More In Google Maps
  5. Google Maps "My Maps" Features
  6. Measuring Elevation, Distance And Area In Google Maps
  7. Creating GPS Routes In Google Maps
  8. Thematic Polygon Shapefile Display In Google Maps
  9. Using The Google Maps Interface To Display General Maps And Images
  10. Heat Mapping In Google Maps
  11. Elevation Profile In Google Maps
  12. Embed Google Maps "My Maps" On Your Web Page
  13. Real-Time Website Visitor Plotting In Google Maps
  14. Customizing Google Maps Markers
  15. Two Fun Cartographic Google Maps Tools
  16. Simple Guide To Embedding Google Maps "My Maps" On Your Own Webpage
  17. Another Google Maps Geocoder/Reverse Geocoder
  18. Drawing Lines Between Points In Google Maps, Straight And Great Circle
  19. Convert A Google Maps Point To Multiple Text Geographic Formats
  20. Meet Your Friends Halfway
  21. Plotting Swivel Data In Google Maps
  22. Meet Your Friends Halfway II
  23. Geographic Midpoint Calculator
  24. GIS-Like Functionality In Google Maps With ZeeMaps
  25. Creating GPS Waypoints Online From The USGS Geographic Names Information System (GNIS)
  26. MapMyRide.com
  27. Exporting KML Data From Google Maps MyMaps To A GPS
  28. Advanced Tool For Embedding Google Maps MyMaps On Your Website
  29. Draw/Label On Google Maps, And Generate GPX/KML/Embeddable Maps
  30. Another Way To Create Embeddable Google Maps With KML Data
  31. Documenting A Journey With Maptales
  32. Plot A Coordinate Position On Different Map Pages
  33. Worldwide Reverse Geocoding With Google Maps
  34. Google Maps Shaded Relief Site Updates
  35. Digipoint 2: Export Of Google Maps Points In Multiple Formats, And Elevation Data
  36. Google Maps Line Tool Now Supports Distance Measurement
  37. Geographically-Linked Video With VeoGeo
  38. Recent Google Maps Tools
  39. Google Maps Mapplets From Zonums Software
  40. Maximize Google Maps With Google Maps Max
  41. Mapping Zip And Area Code Boundaries, And More
  42. Altitudes And Terrain Profiles In Google Maps
  43. “Friendly” URLs To Address Maps
  44. Quick Zip Code Information
  45. Simple Online Form For Creating An Embeddable Google Map
  46. Embed Synchronized Google/Microsoft Virtual Earth Maps On Your Website/Blog
  47. Worldwide Contour Lines In Google Maps’ Terrain View
  48. Plot Gazetteer Features In A Google Maps Interface
  49. Antipodes Map
  50. New Features At MapChannels.Com
  51. Small, Simple Tool For Getting Distances And Bearings Between Points In Google Maps


Subscribe to this blog's RSS feed

0 Responses to “Thematic Polygon Shapefile Display In Google Maps”


  1. No Comments

Leave a Reply


Be sure to enter the "reCAPTCHA" below before submitting your comment.