Converting shapefiles and KML files

Google Earth Pro is a slightly more advanced version than the free edition of the popular satellite imagery application (okay, it does way more, but many people just use that feature). One major additional feature it includes is the ability to import GIS shapefiles and display their features on top of the imagery, including terrain. It’s useful to have your data as KML (Keyhole Markup Language) because KML (or KMZ) is easier to share and Google Earth standard edition is free. But then again, it’s useful to have your KML files as shapefiles because proper GIS software is more powerful at analyzing data. Also, someone might ask you for your data in shapefile format (but they could easily follow these instructions).

Good data management requires options. Options mean your data won’t be locked into a proprietary format. Data want to be free! Read on for ways to convert your KML and shapefile data:

Converting KML files to shapefiles

Like Google Earth Pro, Quantum GIS (QGIS) can convert KML or KMZ to shapefile, and best of all – it doesn’t cost $400 per year (it’s free!). QGIS is a cross-platform application meaning it will run on Windows, Mac OS X, and Linux.

Use QGIS to convert a KML or KMZ file to shapefile:

  1. Click on Layer > Add Vector Layer
  2. Find your KML or KMZ file.
  3. Right-click your new layer and click “Save as shapefile.”

Zonums provides online conversion tools. Or, use ArcGIS and this plugin to convert KML files to shapefiles.

Converting shapefiles to KML files

The freeware Shp2kml 2.o (Windows only) from Zonums will convert shapefiles to KML files. Want some free, interesting data to try it out? Check my ever expanding repository.

ESRI’s ArcGIS can convert KML files to shapefiles using this plugin and then import the shapefile as a layer onto your map.

Creating KML files online

As I described in this post, BatchGecode will generate a KML file for you by inputting a list of addresses and names. Additionally, Google Earth (part of the rising Google GIS platform) creates KML files. Google’s My Maps feature also allows you to generate KML files (for sharing or download) by clicking and drawing points and lines on a map and inviting you to describe the features you create. Use this to get a map of your church congregation, or a map of people who voted for your candidate.

GeoCommons Finder lets you upload geodata in many formats, save it to your profile, and then download it into multiple formats. You can upload a shapefile (.shp) and its accompany files (shx, dbf, and prj), verify that it read your data correctly,

More choices for converting

Additional software with conversion capabilities:

  • MapWindow (another free software choice; Windows only) – An alternative to QuantumGIS and ArcGIS.
  • ExpertGPS (Windows only, not free) – Ideal for GPS device owners, or for researchers using GPS devices in projects. But it can convert the GPS and shapefile data into KML, shapefiles, or a spreadsheet, amongst other functions.
  • Zonums, creator of the standalone Shp2kml software converter, now offers many online tools for KML users, including one that reverses the conversion and exports shapefiles from KML files. I found the link on FreeGeographyTools.com.
  • OpenGeo Suite – Commercial software with non-profit licenses.
  • uDig – Free GIS software, but I haven’t had good experiences with it on my computers.

GeoCommunity has a good article, with screenshots, on how some of these programs work.

Need to work with General Transit Feed Spec (GTFS) data?

flattr this!

About Steven Vance

Enthusiast for urbanism, bicycling as transportation, and open data. Building a bicycle culture in Chicago.
  • http://www.personal.psu.edu/fah109/ Frank Hardisty

    Hi,

    Nice post. One quick correction: QGis is not written in Java. It is Open Source, it is free, and it is cross-platform, so you might think is a member of the Java tribe, but the cross-platform magic comes from using the QT toolkit (from Trolltech). I am fairly sure QGIS is primarily done in C++, with nice Python bindings.

    regards,
    -Frank

    • http://www.stevevance.net/planning Steven Vance

      Thank you for the correction. I did make the assumption that since it was cross-platform, it must have been written in Java.

  • http://www.personal.psu.edu/fah109/ Frank Hardisty

    Hi,

    Nice post. One quick correction: QGis is not written in Java. It is Open Source, it is free, and it is cross-platform, so you might think is a member of the Java tribe, but the cross-platform magic comes from using the QT toolkit (from Trolltech). I am fairly sure QGIS is primarily done in C++, with nice Python bindings.

    regards,
    -Frank

  • http://www.stevevance.net/planning Steven Vance

    Thank you for the correction. I did make the assumption that since it was cross-platform, it must have been written in Java.

  • http://fevisis.6te.net fevisis dev team

    Hi all,

    We have a converter to convert Google Earth’s KML file to Shape file(kml2shp). This converter can convert any type of KML to the Shape file format as per the standards. With this converter, you get the advantage of having your own shape file for any area of the world thus relieving your need to search or purchase the Shape file . This converter proves to be a User Friendly one as its GUI is so simple that you don’t need to specify anything for conversion.

    You all get this for a very minimal one time cost. If you like to have your own converter for generating shape file, reach us at [email protected]

    Best Regards
    fevisis dev team

    Blogs:
    http://fevisis.6te.net
    http://fevisis.wordpress.com

    Website:
    http://www.fevisis.com

  • http://fevisis.6te.net fevisis dev team

    Hi all,

    We have a converter to convert Google Earth's KML file to Shape file(kml2shp). This converter can convert any type of KML to the Shape file format as per the standards. With this converter, you get the advantage of having your own shape file for any area of the world thus relieving your need to search or purchase the Shape file . This converter proves to be a User Friendly one as its GUI is so simple that you don't need to specify anything for conversion.

    You all get this for a very minimal one time cost. If you like to have your own converter for generating shape file, reach us at [email protected]

    Best Regards
    fevisis dev team

    Blogs:
    http://fevisis.6te.net
    http://fevisis.wordpress.com

    Website:
    http://www.fevisis.com

  • Jennifer

    Thank you thank you thank you for providing a link to QGIS. It converted my KML files to shapefiles perfectly. I don’t know why it doesn’t come up readily in Google searches.

    • http://www.stevevance.net/planning Steven Vance

      You’re welcome.
      KML and GIS are such hot keywords that it’s hard to sort through the riffraff. This article, though, continues to show up in the top 10 results. If you have a website, you should link to it ;)

  • Jennifer

    Thank you thank you thank you for providing a link to QGIS. It converted my KML files to shapefiles perfectly. I don't know why it doesn't come up readily in Google searches.

  • http://www.stevevance.net/planning Steven Vance

    You're welcome.
    KML and GIS are such hot keywords that it's hard to sort through the riffraff. This article, though, continues to show up in the top 10 results. If you have a website, you should link to it ;)

  • José Manuel

    Man, you make my day! in adition I’ve found Quantum GIS so interesting! Thank you so much.

    • http://www.stevevance.net/planning Steven Vance

      I’m glad I could help. What did you need to do that this article helped you with?

  • José Manuel

    Man, you make my day! in adition I’ve found Quantum GIS so interesting! Thank you so much.

    • http://www.stevevance.net/planning Steven Vance

      I’m glad I could help. What did you need to do that this article helped you with?

  • Pingback: Steven Can Plan – Free online GIS tools: An introduction to GeoCommons

  • http://theplannersdreamgonewrong.blogspot.com jason tinkey

    I love that it seems like anything I’m trying to do, you’ve got something to help.

    • http://www.stevevance.net/planning Steven Vance

      Awesome!

      What else do you need?

      • http://theplannersdreamgonewrong.blogspot.com jason tinkey

        well, i managed to import the kml into qgis, but i’m having a hard time changing the projection and scale to match the shp layers. any suggestions?

        • http://www.stevevance.net/planning Steven Vance

          Right click the imported layer and click “Save As.”
          In the dialog box, select ESRI Shapefile as the type and then select the new projection.
          Save the file and then import the new file.

          Also, in each layer’s property settings, ensure that QGIS knows which projection should be applied to each layer.
          Also set the projection for the project in File>Project Properties. You can also select “Enable ‘on the fly’ CRS transformation.” I use this because some of my data is projected as NAD83 Illinois FIPS West-Feet (like crash data from IDOT) and other data is projected as NAD83 Illinois FIPS East-Feet (like Chicago geography).

  • http://blog.theplannersdreamgonewrong.com jason tinkey

    I love that it seems like anything I’m trying to do, you’ve got something to help.

    • http://www.stevevance.net/planning Steven Vance

      Awesome!

      What else do you need?

      • http://blog.theplannersdreamgonewrong.com jason tinkey

        well, i managed to import the kml into qgis, but i’m having a hard time changing the projection and scale to match the shp layers. any suggestions?

        • http://www.stevevance.net/planning Steven Vance

          Right click the imported layer and click “Save As.”
          In the dialog box, select ESRI Shapefile as the type and then select the new projection.
          Save the file and then import the new file.

          Also, in each layer’s property settings, ensure that QGIS knows which projection should be applied to each layer.
          Also set the projection for the project in File>Project Properties. You can also select “Enable ‘on the fly’ CRS transformation.” I use this because some of my data is projected as NAD83 Illinois FIPS West-Feet (like crash data from IDOT) and other data is projected as NAD83 Illinois FIPS East-Feet (like Chicago geography).

  • Josegis2010

    Hi,
    i try to open kml file using Qgis but it cant open it  whats the problem on it ?anybody can suggest be !

    • bgladd

      Are you using the Layer – Add Vector layer to import the .kml ? You can’t use the file-open project.

  • Pingback: Some tests of geo-localization with Google Maps and Batchgeo | Devam edecek…

  • Pingback: jlkutughk

  • Pingback: email marketing

  • Pingback: Toshiba laptop

  • Pingback: link building

  • Pingback: cheap is my main Keyword.

  • Pingback: my url

  • Pingback: wof christchurch

  • Siar

    Hi, don’t know if you need it, but I use a simple online tool to convert KML files into GPX files. http://kml2gpx.com works both ways and it has an option for zip files. Hope it might come in handy.

  • chevas

    Works fine, but I can only convert one file at once. Since I have more than 200 files to convert, is there any (free) way to do “batch conversion” from KML to SHP in QGis ?