Rock out with your Bloch out.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
Bloch Moved to a package directory for setuptools compatibility Oct 7, 2010


Bloch - Simplify linework in polygonal geographic datasources.


    Inspired by Matthew Bloch's MapShaper thesis (, Bloch can
    load OGR-compatible data sources and simplify the linework while preserving
    topology. The simplify() method accepts tolerances in map units, so
    simplification can be performed by known amounts with predictable outcomes.
    Dependencies include Warmerdam (
    and Gillies (,
    Example usage:
      # Load a data file into a Datasource instance.
      datasrc = load('input.json')
      # Simplify the geometry.
      # Save it out to a new shapefile.
      save(datasrc, 'output1.shp')
      # This will throw an error, because 250 < 500.
      # Simplify the geometry more.
      # Save it out to a new GeoJSON file.
      save(datasrc, 'output2.json')

    class Datasource
     |  Store an exploded representation of a data source, so it can be simplified.
     |  Methods defined here:
     |  __init__(self, srs, geom_type, fields, values, shapes)
     |      Use load() to call this constructor.
     |  simplify(self, tolerance, verbose=False)
     |      Simplify the polygonal linework.
     |      This method can be called multiple times, but the process is
     |      destructive so it must be called with progressively increasing
     |      tolerance values.

    load(filename, verbose=False)
        Load an OGR data source, return a new Datasource instance.
    save(datasource, filename)
        Save a Datasource instance to a named OGR datasource.