CGAL failed to create straightSkeleton
Created by: StyXman
Another issue, similar to #111 (closed). I simplified the polygon using this code:
https://gist.github.com/StyXman/174df434435529fb73e8edc014ea52ac
I got down to a 14-node Polygon:
POLYGON ((4.6496243000000002 43.5206941000000000, 4.6525242999999996 43.5138711000000029, 4.6538323000000004 43.5135961000000009, 4.6575601000000004 43.5140630000000002, 4.6610893000000004 43.5289111000000020, 4.6611813000000000 43.5289641000000032, 4.6613262999999998 43.5290541000000033, 4.6616742999999996 43.5292700999999980, 4.6662613000000004 43.5319630999999987, 4.6694462999999997 43.5364300999999969, 4.6773002999999997 43.5426701000000023, 4.6773223000000002 43.5500510999999975, 4.6770063000000004 43.5516341000000011, 4.6727913000000001 43.5583450999999968, 4.6499202999999998 43.5215560999999980, 4.6496243000000002 43.5206941000000000))
This is the tests I did on it:
gis=> select ST_StraightSkeleton ('POLYGON ((4.6496243000000002 43.5206941000000000, 4.6525242999999996 43.5138711000000029, 4.6538323000000004 43.5135961000000009, 4.6575601000000004 43.5140630000000002, 4.6610893000000004 43.5289111000000020, 4.6611813000000000 43.5289641000000032, 4.6613262999999998 43.5290541000000033, 4.6616742999999996 43.5292700999999980, 4.6662613000000004 43.5319630999999987, 4.6694462999999997 43.5364300999999969, 4.6773002999999997 43.5426701000000023, 4.6773223000000002 43.5500510999999975, 4.6770063000000004 43.5516341000000011, 4.6727913000000001 43.5583450999999968, 4.6499202999999998 43.5215560999999980, 4.6496243000000002 43.5206941000000000))');
NOTICE: During straight_skeleton(A) :
NOTICE: with A: POLYGON((5235011566223201/1125899906842624 3062496589557271/70368744177664,1309569168988261/281474976710656 3062016463615747/70368744177664,5239749353031195/1125899906842624 1530998556105549/35184372088832,5243946482703923/1125899906842624 61240
ERROR: CGAL failed to create straightSkeleton
And according to GEOS (python-shapely
uses it internally), the polygon is valid:
In [1]: import shapely.wkt
In [2]: sh= shapely.wkt.loads ('POLYGON ((4.6496243000000002 43.5206941000000000, 4.6525242999999996 43.5138711000000029, 4.6538323000000004 43.5135961000000009, 4.6575601000000004 43.5140630000000002, 4.6610893000000004 43.5289111000000020, 4.6611813000000000 43.5289641000000032, 4.6613262999999998 43.5290541000000033, 4.6616742999999996 43.5292700999999980, 4.6662613000000004 43.5319630999999987, 4.6694462999999997 43.5364300999999969, 4.6773002999999997 43.5426701000000023, 4.6773223000000002 43.5500510999999975, 4.6770063000000004 43.5516341000000011, 4.6727913000000001 43.5583450999999968, 4.6499202999999998 43.5215560999999980, 4.6496243000000002 43.5206941000000000))')
In [3]: sh.is_valid
Out[3]: True
I hope the test case is ok, I'm not really convinced my simplification algorithm makes sense.
Edited by lbartoletti