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

wrong WKT input can make prepair segfault #10

Closed hugoledoux closed 10 years ago

hugoledoux commented 10 years ago

Added some defensive code to parse the WKT, but OGR doesn't seem to handle all case. Eg:

$ ./prepair --wkt 'POLYGON((0 0))' Segmentation fault: 11

And it doesn't check the first-last are the same either

kenohori commented 10 years ago

Maybe we should add an additional validation/repair process even before the triangulation. Syntactic repair?

Also, we should probably move this code to Polygon_repair.cpp.

hugoledoux commented 10 years ago

I still think that OGR should have that somewhere, or some code somewhere. Insane if we have to write that ourselves. PostGIS has good code, we should check it.

hugoledoux commented 10 years ago

duh, it shouldn't check if first-last are the same, we're repairing these things too! So it's probably okay now, except the segfault

kenohori commented 10 years ago

Fixed in new code.