Reading KML | KML to MapInfo TAB

Liz Sanderson
Liz Sanderson
  • Updated

FME Version

Introduction

FME is able to read KML datasets, including all of the spatial components, as well as items such as document properties, folders, and timestamp attributes.

FME can also convert KML datasets into a variety of output formats. The following simple translation of KML to MapInfo TAB can be applied to a number of formats other than MapInfo TAB.

 

Video

See how to read KML data (including documents, folders, timestamps, cameras, and network links) and convert it to MapInfo. This video was recorded with an older version of FME, so the interface will be different, but the concepts are the same.

 

Step-by-step Instructions

1. Open FME Workbench

In a blank workspace, add a KML reader to the canvas, this can be done by going to Readers > Add Reader on the top menu bar or by clicking on the Reader button. In the Add Reader dialog, enter Google KML as the Format, then browse to the Properties.kml file included in the downloads. Click OK to add the reader.

kmlreader.jpg

 

When adding KMLs to FME, there are several different KML layers that can be added, in FME we call these feature types. After clicking OK to add the reader, a Select Feature Types dialog will appear, here you can select any of the feature types (layers) that you are interested in. Typically, only one layer will contain the geometry features, and will be a layer with a unique name.

For this dataset, the feature type we are interested in is LandParcels, unselect all of the other feature types and then click OK.

selectft.jpg

 

2. Inspect Data

Now that we have added the LandParcels feature type, we should inspect the data to see what we are working with. In older versions of FME, you can add an Inspector transformer and then run the workspace to view the data in FME Data Inspector.

inspector.jpg

 

For newer versions, ensure that Feature Caching is enabled and then run the workspace. Once the workspace has run, click on the green magnifying glass to view the data cache in Visual Preview.

viewcache.jpg

There should be 10840 rows in the table, as well the coordinate system should be LL84. KML only supports the WGS84 datum, and the FME equivalent coordinate systems are LL84 and EPSG:4326.

visualpreview.jpg

 

Unexpected Input

The Unexpected Input Remover is a function that discards such data. It checks the input data against the structure (or schema) defined in the workspace. If the data doesn't have a matching feature type, it is discarded. If you encounter this popup or message in the translation log, it is safe to ignore it when reading in KML. For more information, please see the Unexpected Input Remover article or blog post.

unexpectedinput.jpg

 

3. Add a MapInfo TAB Writer

One final step is to write out the data to MapInfo TAB. Add a MapInfo TAB (MITAB) writer to the canvas then browse to a folder to save the file. Ensure that the Table Definition is set to Copy from Reader and then click OK.

mapinfowriter.jpg

 

Once the writer feature type is added to the canvas, connect it to the LandParcels reader feature type.

 

4. Save and Run Workspace

Before running the workspace, ensure that you save it. After the workspace has been run, you can view the output by clicking on the LandParcels writer feature type to open the popup menu and then clicking on View Written Data.

viewwrittendata.jpg

output.jpg

 

Data Attribution

Data used in this article originates from open data made available by the City of Austin, Texas. It contains data licensed under the Public Domain Dedication License - City of Austin.

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.