I have polygons that have curved polygon i need to make into regular polygons.
My issue is that st_curvetoline creates invalid geometries with self intersection. How can i solve that?
I have tried to read up on the docs for curvetoline but most of it goes over my head. If I run ST_MakeValid after used curvetoline i do get valid geometries, but they is resulting in mmultipolygon. I hope someone have an advice
Using this expression I do end up with only two invalid geometries
st_curvetoline(geom, 32, 0, 1)
This is the original geometry before CurveToLine
CURVEPOLYGON Z (COMPOUNDCURVE ((567307.72 7026800.0 0.0, 567311.29 7026806.08 0.0, 567317.66 7026815.15 0.0, 567317.971120521 7026816.64276846 0.0, 567318.26 7026818.14 0.0), CIRCULARSTRING (567318.26 7026818.14 0.0, 567320.0114085932 7026836.511864702 0.0, 567318.44 7026854.9 0.0), (567318.44 7026854.9 0.0, 567311.97 7026883.44 0.0), CIRCULARSTRING (567311.97 7026883.44 0.0, 567313.0778924308 7026889.572953749 0.0, 567318.25 7026893.05 0.0, 567309.6188196365 7026891.06309699 0.0, 567301.15 7026888.47 0.0, 567304.403439805 7026888.184955649 0.0, 567306.36 7026885.57 0.0), (567306.36 7026885.57 0.0, 567313.56 7026853.79 0.0), CIRCULARSTRING (567313.56 7026853.79 0.0, 567314.4459599466 7026826.481785534 0.0, 567307.72 7026800.0 0.0)))
This is the result which is invalid (self intersection)
POLYGON Z((567307.72 7026800 0, 567311.29 7026806.08 0, 567317.66 7026815.15 0, 567317.971120521 7026816.64276846 0, 567318.26 7026818.14 0, 567319.0080971383 7026822.698678211 0, 567319.550027991 7026827.286434451 0, 567319.8846917419 7026831.893949674 0, 567320.0114085932 7026836.511864702 0, 567319.9299211466 7026841.130799228 0, 567319.6403949267 7026845.741370878 0, 567319.1434180437 7026850.334214261 0, 567318.44 7026854.9 0, 567311.97 7026883.44 0, 567311.8940170873 7026883.820427269 0, 567311.8365660114 7026884.204090771 0, 567311.7977818709 7026884.590088309 0, 567311.7777558683 7026884.977512197 0, 567311.7765350953 7026885.365451392 0, 567311.7941224227 7026885.7529936405 0, 567311.8304764932 7026886.139227625 0, 567311.8855118189 7026886.523245102 0, 567311.9590989823 7026886.904143039 0, 567312.0510649404 7026887.281025742 0, 567312.161193432 7026887.653006957 0, 567312.2892254861 7026888.019211958 0, 567312.4348600305 7026888.378779599 0, 567312.5977546005 7026888.730864345 0, 567312.7775261435 7026889.074638256 0, 567312.9737519203 7026889.4092929335 0, 567313.1859704988 7026889.734041427 0, 567313.4136828396 7026890.048120079 0, 567313.6563534687 7026890.35079032 0, 567313.9134117374 7026890.641340411 0, 567314.1842531639 7026890.919087115 0, 567314.4682408549 7026891.183377297 0, 567314.7647070029 7026891.4335894715 0, 567315.0729544574 7026891.669135255 0, 567315.392258363 7026891.889460753 0, 567315.7218678653 7026892.094047862 0, 567316.0610078756 7026892.282415489 0, 567316.4088808938 7026892.454120679 0, 567316.7646688842 7026892.608759662 0, 567317.1275351983 7026892.745968799 0, 567317.496626543 7026892.865425438 0, 567317.8710749865 7026892.966848671 0, 567318.25 7026893.05 0, 567312.4799648649 7026891.793308651 0, 567306.7757212023 7026890.265505377 0, 567301.15 7026888.47 0, 567301.3331105985 7026888.528474296 0, 567301.5188189475 7026888.578084212 0, 567301.7066961917 7026888.618715182 0, 567301.8963084667 7026888.650273379 0, 567302.087217902 7026888.672685924 0, 567302.2789836308 7026888.68590106 0, 567302.4711628096 7026888.689888271 0, 567302.6633116398 7026888.6846383475 0, 567302.8549863927 7026888.6701634135 0, 567303.0457444347 7026888.646496897 0, 567303.235145249 7026888.61369345 0, 567303.4227514532 7026888.571828825 0, 567303.6081298089 7026888.520999701 0, 567303.7908522226 7026888.461323457 0, 567303.9704967343 7026888.392937902 0, 567304.1466484916 7026888.31600096 0, 567304.318900708 7026888.230690301 0, 567304.486855602 7026888.137202932 0, 567304.6501253163 7026888.035754743 0, 567304.8083328126 7026887.926580008 0, 567304.9611127432 7026887.809930844 0, 567305.1081122939 7026887.686076629 0, 567305.2489919991 7026887.555303377 0, 567305.3834265261 7026887.417913085 0, 567305.5111054257 7026887.274223025 0, 567305.6317338494 7026887.124565021 0, 567305.7450332307 7026886.969284679 0, 567305.8507419279 7026886.808740585 0, 567305.948615828 7026886.643303485 0, 567306.0384289112 7026886.47335542 0, 567306.1199737729 7026886.299288852 0, 567306.1930621016 7026886.121505751 0, 567306.2575251148 7026885.940416672 0, 567306.3132139483 7026885.756439803 0, 567306.36 7026885.57 0, 567313.56 7026853.79 0, 567314.240793959 7026849.272632654 0, 567314.7092366826 7026844.728334075 0, 567314.9642997483 7026840.1670808485 0, 567315.0054231889 7026835.598886783 0, 567314.8325167217 7026831.033780923 0, 567314.4459599467 7026826.481785535 0, 567313.8466015134 7026821.9528941 0, 567313.0357572577 7026817.457049379 0, 567312.0152073125 7026813.004121582 0, 567310.7871922005 7026808.603886697 0, 567309.3544079148 7026804.266005031 0, 567307.72 7026800 0))