Starting from this set of geometries:
I need to achieve this result (from ArcMap's Dissolve algorithm):
But what I get from PostGIS is this:
Here is the query I use:
SELECT (ROW_NUMBER() OVER())::integer as id, ST_Union(geom) as geom
from data.ai_pro_priv
WHERE code_proje = 'X543'
I also tried ST_CurveToLine and ST_SnapToGrid without success... it only generates a slightly different problem. What should I do to completely dissolve adjacent polygons that use Curved lines?
Here is a query that uses ST_Union on two CurvedPolygons from the original dataset I am working on:
SELECT (row_number() over())::integer as id, ST_Union(ST_GeomFromEWKT('SRID=32198;CURVEPOLYGON(COMPOUNDCURVE(CIRCULARSTRING(-325654.692836004 153091.965175714,-325651.529223593 153087.79262716,-325648.77605614 153083.33856405),(-325648.77605614 153083.33856405,-325644.535347645 153075.687053628,-325657.675571565 153068.404341695,-325662.530678016 153077.164489657,-325660.968899191 153078.030087019),CIRCULARSTRING(-325660.968899191 153078.030087019,-325659.498871638 153079.977667299,-325659.958956704 153082.373991806,-325669.326428496 153092.242677797,-325681.212224351 153098.865992548,-325701.378631971 153101.488082841,-325720.644831036 153094.978627806),(-325720.644831036 153094.978627806,-325743.236798293 153081.021729371),CIRCULARSTRING(-325743.236798293 153081.021729371,-325744.753792044 153079.949460994,-325746.12694377 153078.698267951),(-325746.12694377 153078.698267951,-325749.201356029 153075.527296877,-325762.238004932 153062.081264152),CIRCULARSTRING(-325762.238004932 153062.081264152,-325764.33142224 153059.357943882,-325765.751670874 153056.230362611),(-325765.751670874 153056.230362611,-325768.212597234 153048.591198465),CIRCULARSTRING(-325768.212597234 153048.591198465,-325774.309426789 153038.594679611,-325784.284691661 153032.463133264),(-325784.284691661 153032.463133264,-325808.546220501 153024.553909092),CIRCULARSTRING(-325808.546220501 153024.553909092,-325818.273645064 153022.534403233,-325828.207192197 153022.695160756),(-325828.207192197 153022.695160756,-325834.936298238 153023.551807672),CIRCULARSTRING(-325834.936298238 153023.551807672,-325843.118481394 153022.898045435,-325850.351532801 153019.017516789),(-325850.351532801 153019.017516789,-325852.249052925 153017.423233668),CIRCULARSTRING(-325852.249052925 153017.423233668,-325862.474433564 153013.912692114,-325872.409274723 153018.176639488,-325877.097220069 153019.894604844,-325881.465415052 153017.476525005,-325875.81750142 153026.463453516,-325871.590921929 153036.19997206,-325871.76193807 153032.850872398,-325870.111545825 153029.931639305),(-325870.111545825 153029.931639305,-325865.411964844 153025.342681346),CIRCULARSTRING(-325865.411964844 153025.342681346,-325862.100361953 153023.921276573,-325858.691894196 153025.091512701),(-325858.691894196 153025.091512701,-325856.794374089 153026.685795322),CIRCULARSTRING(-325856.794374089 153026.685795322,-325845.944771243 153032.50667439,-325833.67142568 153033.487221894),(-325833.67142568 153033.487221894,-325826.942420912 153032.630581988),CIRCULARSTRING(-325826.942420912 153032.630581988,-325819.216339481 153032.50561394,-325811.65055841 153034.076251967),(-325811.65055841 153034.076251967,-325787.389033247 153041.985472575),CIRCULARSTRING(-325787.389033247 153041.985472575,-325781.403882763 153045.66442046,-325777.745736274 153051.662306531),(-325777.745736274 153051.662306531,-325775.284808489 153059.301469929),CIRCULARSTRING(-325775.284808489 153059.301469929,-325772.917894974 153064.514205852,-325769.428792625 153069.053044171),(-325769.428792625 153069.053044171,-325753.317730673 153085.670043392),CIRCULARSTRING(-325753.317730673 153085.670043392,-325751.441043503 153087.417054594,-325749.395566885 153088.963026066,-325748.951200675 153089.257461934,-325748.500752738 153089.542506599),(-325748.500752738 153089.542506599,-325725.908787178 153103.499399983),CIRCULARSTRING(-325725.908787178 153103.499399983,-325688.149925134 153111.012543511,-325654.692836004 153091.965175714)))'), ST_GeomFromEWKT('SRID=32198;CURVEPOLYGON(COMPOUNDCURVE(CIRCULARSTRING(-325749.395566885 153088.963026066,-325751.441043503 153087.417054594,-325753.317730673 153085.670043392),(-325753.317730673 153085.670043392,-325769.428792625 153069.053044171),CIRCULARSTRING(-325769.428792625 153069.053044171,-325772.917894974 153064.514205852,-325775.284808489 153059.301469929),(-325775.284808489 153059.301469929,-325777.745736274 153051.662306531),CIRCULARSTRING(-325777.745736274 153051.662306531,-325781.403882763 153045.66442046,-325787.389033247 153041.985472575),(-325787.389033247 153041.985472575,-325811.65055841 153034.076251967),CIRCULARSTRING(-325811.65055841 153034.076251967,-325819.216339481 153032.50561394,-325826.942420912 153032.630581988),(-325826.942420912 153032.630581988,-325833.67142568 153033.487221894),CIRCULARSTRING(-325833.67142568 153033.487221894,-325845.944771243 153032.50667439,-325856.794374089 153026.685795322),(-325856.794374089 153026.685795322,-325858.691894196 153025.091512701),CIRCULARSTRING(-325858.691894196 153025.091512701,-325862.100361953 153023.921276573,-325865.411964844 153025.342681346),(-325865.411964844 153025.342681346,-325870.111545825 153029.931639305),CIRCULARSTRING(-325870.111545825 153029.931639305,-325871.76193807 153032.850872398,-325871.590921929 153036.19997206,-325870.276312519 153040.415758165,-325869.229700012 153044.705938721),(-325869.229700012 153044.705938721,-325861.658036114 153080.620756347),CIRCULARSTRING(-325861.658036114 153080.620756347,-325856.893352934 153092.269410671,-325848.32159799 153101.484523213),(-325848.32159799 153101.484523213,-325790.778719013 153144.422327206,-325749.395566885 153088.963026066)))')) as geom



ST_ExteriorRings maybe. – geozelot Aug 30 '18 at 14:34ST_Unionworks on point sets, and the arcs ofCURVEScannot sufficiently represented in geometric primitives (2 points -> line). no matter how you try to transform them (ST_SnapToGrid,ST_CurveToLine), the vertices of those borders will always be off, resulting in gaps. buffering in/out or polygonizing the exterior ring is your best bet here I'd say – geozelot Aug 30 '18 at 16:14