How to Convert Google KML to Esri Shapefile

Liz Sanderson
Liz Sanderson
  • Updated

Introduction

In this tutorial we will translate Google KML (*.kml) data, representing neighborhood areas, to Esri shapefile (*.shp) format. Our goal will be to create an Esri shapefile of neighborhoods, and to calculate the percent increase in population between 2001 and 2011.

The VancouverNeighborhoods.kml Google Earth file contains area features representing neighborhoods, along with accompanying attribute information including population data.

Video

This video was created with FME version 2016.0. Some of the steps might be slightly different, but the overall process is the same for newer versions of FME.

Step-By-Step Instructions

1. Inspect the Data in FME

The first step is to inspect the VancouverNeighborhoods.kml file. Open a blank FME Workspace and add a new reader. In the reader dialog, type in GoogleKML, then browse to the VancouverNeighborhoods.kml file. Click OK to add the reader to the canvas.

reader.png

In the Select Feature Types dialog, click the Select All box to unselect all of the feature types and then select the Neighborhoods feature type.

selectft.png

Now, to view the data, click on the Neighborhood reader feature type on the canvas to open the mini toolbar. Then, on the mini toolbar, click the View Source Data button to view the data in the Visual Preview Window.

readerpopup.png

In the Visual Preview window (or FME Data Inspector), click the drop-down in the table window and select Neighborhoods to view the Neighborhoods attributes. Take note of the length of the attribute names, as we plan to write them out to an Esri shapefile. We will need to shorten the attribute names to 10 characters or less.

visualpreview.png

2. Set the Output (Writer) Format to Esri Shapefile

Next, we need to add a writer to the canvas. Click on "Add Writer" and, in the "Add Writer" dialog box, select "Esri Shapefile" for the format. Then, for the Dataset, browse to a folder to save the shapefile, and then click OK to add the writer.

writer.png

3. Clean up Attribute Names

To shorten the attribute names, we will need to use an AttributeManager transformer. Add an AttributeManager transformer to the canvas and connect the input port to the Neighborhoods reader feature type and the output to the Neighborhoods writer feature type.

attributemanworkflow.png

Open the AttributeManager parameters and change the following Output Attributes:

Input Attribute Output Attribute
NeighborhoodID NeighID
NeighborhoodName NeighName
NeighborhoodURL NeighURL
TotalPopulation2001 Pop2001
TotalPopulation2011 Pop2011

attributemanager.png

4. Update Writer Properties

Now that we have renamed the attributes, we need to update the writer to reflect the name change. Open the writer feature type parameters and switch to the User Attributes tab. In this tab, we can see that the attributes are not the same as the ones we recently renamed in the Attribute Manager. To easily fix this, switch the Attribute Definition to Automatic, and it will automatically update to the attributes we renamed. Click OK to accept the new attribute names.

writerparams.png

5. Calculate Population Increase

The final step before running the translation is to calculate the population increase; we will do this using an ExpressionEvaluator transformer. Add an ExpressionEvaluator to the canvas and connect it between the AttributeManager and the writer feature type.

expressionworkflow.png

In the ExpressionEvaluator parameters, set the New Attribute name to PopChange. Then, in the Arithmetic Expression window, set the expression to: ((@Value(Pop2011)-@Value(Pop2001))/@Value(Pop2001))*100

This expression calculates the percent increase between the 2001 and 2011 populations. It does this by taking the absolute value of the difference and dividing it by the original value - the resulting decimal is then converted to a percent.

expressioneval.png

Since we set the writer feature type definition to Automatic, the PopChange attribute will automatically be added to the writer. This can be confirmed by expanding the Neighborhoods writer feature type to view the attributes.

writerattributes.png

6. Run the Workspace

The workspace is now ready to be run. Run the workspace by clicking on the green play button.

7. View the Output Dataset

To view the output dataset, click on the Neighborhoods writer feature type to open the mini toolbar. Then click on the View Output Data button.

writerpopup.png

The attributes have been renamed, and we now have a PopChange column containing the population change data as a percent.

output.png

Data Attribution

The data used here originates from open data made available by the City of Vancouver, British Columbia. It contains information licensed under the Open Government License - Vancouver.

Was this article helpful?

We're sorry to hear that.

Please tell us why.

As of January 14th, 2026, comments on knowledge base articles have been closed. To make sure questions don’t get missed and to enable more community support, we’ve moved discussions to the FME Community. If you have a question or a comment about this article, please create a new post or create a support ticket.