16

Is there any tool available which let's me run millions of parcel shapefiles and simplify them?

  • 1
    what do you mean by simplify, the edge? – artwork21 May 12 '11 at 1:48
  • 1
    I think I would be concerned about running simplify on polygons without some type of topology. I don't even think esri will manage two edges being simpplified simultaneously so they remain consistent. Maybe I'm wrong. – Brad Nesom May 12 '11 at 4:21
6

You could try Shapely - a Python API built on top of GEOS. As both Shapely and GDAL have Python libraries you can easily combine them to data from many different sources (including shapefiles) and then simplifying and exporting as desired.

The only downside may be speed if you are doing millions of features - it could be faster to use GEOS or JTS directly.

See the simplify method:

All points in the simplified object will be within the tolerance distance of the original geometry. By default a slower algorithm is used that preserves topology. If preserve topology is set to False the much quicker Douglas-Peucker algorithm is used.

>>> p = Point(0.0, 0.0)
>>> x = p.buffer(1.0)
>>> x.area
3.1365484905459389
>>> s = x.simplify(0.05, preserve_topology=False)
>>> s.area
3.0614674589207187
|improve this answer|||||
14

Version 9.0 of GDAL/OGR added the -simplify option to the ogr2ogr command. The documentation indicates that it preserves topology.

-simplify tolerance: (starting with GDAL 1.9.0) distance tolerance for simplification. This method will preserve topology, in particular for polygon geometries.

Example usage:

ogr2ogr outfile.shp infile.shp -simplify 0.000001
|improve this answer|||||
8

If your data is stored in PostGIS, try using ST_SimplifyPreserveTopology.

|improve this answer|||||
6

ogr2ogr has a "segmentize" option that appears to do what you need: GDAL ogr2ogr documentation

From that page:

-segmentize max_dist: (starting with GDAL 1.6.0) maximum distance between 2 nodes. Used to create intermediate pointsspatial query extents

|improve this answer|||||
5

You could try Mapshaper. There are maybe some limitations due to your file size.

|improve this answer|||||
4

GRASS v.generalize

http://grass.osgeo.org/gdp/html_grass64/v.generalize.html

|improve this answer|||||
  • I made some test and as of today, all methods suggested here and relying on GEOS (ogr2ogr with -simplify, shapely, PostGIS's ST_SimplifyPreserveTopology function) produce topological anomalies (i.e. holes/overlaps between polygons). Only with GRASS I had good results. – capooti Sep 18 '12 at 15:42
3

Inspire from Mapshaper, but directly in local, look on https://github.com/migurski/Bloch

|improve this answer|||||
  • thanks for your response. I guess the issue here is what to do if no topology is define with the shapefile – NetConstructor.com Jun 26 '12 at 14:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.