Skip to main content
Question

How can I optimize a very large shapefile (100+ MB) in order to convert it into a reasonably-sized KML (small enough to easily open/view in Google Earth)?

  • July 14, 2018
  • 2 replies
  • 175 views

I'm trying convert Census block shapefiles (see link: https://www.census.gov/cgi-bin/geo/shapefiles/index.php?year=2017&layergroup;=Blocks+%282010%29) into KMLs that can be opened easily in GE. The Census Bureau has readily available state-by-state KMLs for tracts and block groups, but for blocks (the smallest unit), they only offer downloads in the form of very, very large shapefiles.

Any suggestions?

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

arnold_bijlsma
Enthusiast
Forum|alt.badge.img+15

To reduce the size of a file regardless of its format, you can do a few things:

  • Reduce the number of attributes, e.g. using the AttributeKeeper
  • Simplify your geometries, e.g. using the Generalizer
  • Convert your file into a (dumb) image.

Any of these will reduce the quality of your data. If you don't want that, you can split the file into a collection of files/tiles. See https://knowledge.safe.com/articles/887/optimizing-large-datasets-for-kml-and-google-earth.html (Beware: this is quite advanced that took me a while to master)


arnold_bijlsma
Enthusiast
Forum|alt.badge.img+15

In the KMLStyler, there is an option Allow Unique Styles Per Feature, where you specify whether you want to have one single style for all features or a style for every feature, i.e. 10 lines of code in the header of your KML file, or 10 lines of code for every feature!

Although having one single style is often insufficient, you could create a separate KML for each style class, e.g. one for each interval or each subtype, unticking that aforementioned option!