ora2pg
ora2pg copied to clipboard
export of circles
Hi folks,
I have a set of polygons inside a oracle table which represent circles. I am trying to import these into postgres 12 using ora2pg. The circle is represented as a SDO_GEOMETRY:
(2003; 32632; (; ; ); (1; 1005; 1; 1; 2; 2; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ); (421819,9016; 5376304,3194; 421744,9016; 5376229,3194; 421819,9016; 5376154,3194; 421894,9016; 5376229,3194; 421819,9016; 5376304,3194; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ))
An insert statement is created that translates the polygon to
ST_GeomFromText('POLYGON (CIRCULARSTRING (421819.9016 5376304.3194, 421744.9016 5376229.3194, 421819.9016 5376154.3194, 421894.9016 5376229.3194, 421819.9016 5376304.3194))', 32632)
Unfortunately this crashes if I try to import it. Yet If I write it to:
ST_BuildArea(ST_GeomFromText('CIRCULARSTRING (421819.9016 5376304.3194, 421744.9016 5376229.3194, 421819.9016 5376154.3194, 421894.9016 5376229.3194, 421819.9016 5376304.3194)', 32632))
The import works quite well. Is there an option to rewrite the insert statements with ora2pg to this ST_BuildArea approach by default so I don't need to manipulate the insert statements by hand? on gis.stackexchange it was advised to rewrite it to : ST_GeomFromText('CURVEDPOLYGON (CIRCULARSTRING (421819.9016 5376304.3194, 421744.9016 5376229.3194, 421819.9016 5376154.3194, 421894.9016 5376229.3194, 421819.9016 5376304.3194))', 32632)