prepair icon indicating copy to clipboard operation
prepair copied to clipboard

Batch processing?

Open ex3ndr opened this issue 7 years ago • 5 comments

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?

ex3ndr avatar Mar 21 '18 10:03 ex3ndr

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

hugoledoux avatar Mar 21 '18 13:03 hugoledoux

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?

ex3ndr avatar Mar 21 '18 14:03 ex3ndr

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

$ ./prepair --shpOut --ogr data/CLC2006_180927.geojson

hugoledoux avatar Mar 21 '18 14:03 hugoledoux

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

ex3ndr avatar Mar 21 '18 14:03 ex3ndr

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

hugoledoux avatar Mar 22 '18 07:03 hugoledoux