Skip to content

Straight Skeleton: Improve error message

lbartoletti requested to merge sk_add_error_point into master

Improve error message to help debbuging issues like #270

PostGIS example with this MR:

gis=# select st_approximatemedialaxis('POLYGON((4080176.3000000003 8844721.8,4081718.2 8844782.4,4082497.2 8844149.8,4083438.3000000003 8845263.5,4083927.8000000003 8845415.700000001,4084142.9000000004 8844949.700000001,4083959.1 8843694.3,4082984.1 8843316.8,4081875.6 8843566.700000001,4080650.3000000003 8842747.8,4079808.3000000003 8843015.4,4080574.4000000004 8843569.700000001,4080625.9000000004 8844455,4080176.3000000003 8844721.8),(4082497.2 8844149.8,4082496.8000000003 8844141.6,4082500.4820263707 8844147.869396253,4082497.2 8844149.8),(4083427.4000000004 8844463.6,4082795.9000000004 8844446.700000001,4082886.2 8843710.5,4083507.9000000004 8843888.9,4083427.4000000004 8844463.6),(4080948 8844295,4081002.3000000003 8843765.1,4081655.1 8843683.700000001,4081714.8000000003 8844385.3,4080948 8844295))'::geometry)
gis-# ;
NOTICE:  During approximate_medial_axis(A) :
NOTICE:    with A: POLYGON((8762111885207143/2147483648 2374236929576141/268435456,4382711545121997/1073741824 4748506393529549/536870912,4383547990002893/1073741824 2374083384495309/268435456,8769116976866919/2147483648 17690527/2,8770168170112615/2147483648 4748846393878119/536870912,2192657523461325/536870912 4748596212033127/536870912,8770235386350797/2147483648 2373961112145101/268435456,8768141589793997/2147483648 2373859777760461/268435456,8765761104170189/2147483648 4747853719561831/536870912,8763129792456295/2147483648 2373707037985997/268435456,8761321611224679/2147483648 4747557742628045/536870912,2190741699611853/536870912 4747855330174567/536870912,2190769348463821/536870912 8844455/1,8762111885207143/2147483648 2374236929576141/268435456),(4383547990002893/1073741824 2374083384495309/268435456,8767095121012327/2147483648 4748162366649139/536870912,8767103028103749/2147483648 4748165732505623/536870912,4383547990002893/1073741824 2374083384495309/268435456),(2192273392323789/536870912 4748335239082803/536870912,2191934358342861/536870912 4748326165964391/536870912,4383965675572429/1073741824 17687421/2,2192316610432205/536870912 4748026699369677/536870912,2192273392323789/536870912 4748335239082803/536870912),(4080948/1 8844295/1,8763885706700391/2147483648 4747960234750771/536870912,8765287584025805/2147483648 4747916533458535/536870912,8765415788799591/2147483648 2374146601045197/268435456,4080948/1 8844295/1))
ERROR:  straight skeleton of Polygon with point touching rings is not implemented. Error at POINT(4383547990002893/1073741824 2374083384495309/268435456)
CONTEXTE : SQL function "st_approximatemedialaxis" statement 2

cc @aledonati

Merge request reports