In the first post of this series, GPS TrackMaker was used as a simple way to export point and line shapefile data to Google Earth’s KML format. But GPS TrackMaker is limited in its ability to export shapefile attribute data; it can only export one attribute to label each shape plotted. And it has difficulty dealing with shapefiles that have large numbers of vertices. Today’s post will deal with a simple free program that allows you to export data from multiple attributes to the KML file, and which also seems to have fewer problems with large shapefiles.
Shp2KML Converter (freeware; registration required) has a very straightforward interface:
Click on the “Load Shapefile” button to open the shapefile you want to convert, which must be in WG84 latitude/longitude coordinates, or use the File => Load menu option. Next, from the top drop-down menu, select the shapefile attribute you want to use to label individual shapes in the Google Earth “Places” pane. In the window below the Name box is a list of all the shapefile attributes; you can select which ones you want to include in the KML file by checking the appropriate box. You have highlight an attribute name first by clicking on it before you can check the box.
Finally, click on “Write KML” (or select File => Save As KML from the menu), and the KML file will be created. Here’s a screenshot from Google Earth showing the results from a large point shapefile that plots Arizona mines:
There are over 10,000 mines in this shapefile; GPS TrackMaker was unable to convert it successfully to KML format, but Shp2KML Converter didn’t have a problem with it. Click on any of the markers above, and a pop-up balloon will appear that has the attribute data you specified above in a single line, each attribute separated from each other by a vertical line “|”. For example, the marker for the “RAY KELVIN” mine is labeled with that name in Google Earth, and clicking on the marker brings up a pop-up with “RAY KELVIN | LEAD, SILVER, COPPER, GOLD, ASBESTOS | UNDERGROUND” as the exported attributes NAME, COMMODITY, and TYPE.
Unlike GPS TrackMaker, you have no control over marker or line color from the Shp2KML Converter program itself, although you can always modify it in Google Earth. And since you can’t modify color based on attribute, a polygon/area shapefile will plot with all areas having the same color. So if you have a shapefile where you want to distinguish between different markers, lines or areas based on an attribute, or you need to re-color shapes outside of Google Earth, Shp2KML Converter won’t do the job for you. But for simple shapefiles with minimal sets of attributes, and for shapefiles with lots of vertices, Shp2KML Converter is fast, easy to use, and produces good results.