tudelft3d / prepair

Automatic repair of single polygons (according to the OGC Simple Features / ISO19107 rules) using a constrained triangulation.
GNU General Public License v3.0
115 stars 24 forks source link

Batch processing? #31

Open ex3ndr opened 6 years ago

ex3ndr commented 6 years ago

Your library is awesome and the only thing on the internet that can be used easily to fix shapes from various datasets.

The only thing it is lacking is batch processing. Invoking this for each file is just too slow. Is there any way to use it for batch processing?

hugoledoux commented 6 years ago

I'd just make a Python script calling the prepair binary. Like here for another project of ours that does the same: https://github.com/tudelft3d/val3dity/blob/master/tools/python/gml2poly/val3dity.py#L119

Hope that helps, Hugo

ex3ndr commented 6 years ago

Thanks for the fast reply, but invoking 800k times is not very fast. (i am trying to fix polygons of all parcels in NYC). Actually it takes 2 hours at least. May be simple change can make file-based WKT processing not only for the first line, but for all of them?

hugoledoux commented 6 years ago

hmmm, but if you have a SHP then all are repaired (option --ogr):

$ ./prepair --shpOut --ogr data/CLC2006_180927.geojson
ex3ndr commented 6 years ago

Documentation is unclear that this is possible. There are some strange words that shp is multipolygon. I assumed that this will be the one.

hugoledoux commented 6 years ago

MultiPolygons are more complex to repair, and we simply process each Polygon them separately, and there's a warning.