iag-geo / psma-admin-bdys

Some utils to make it easier to use the PSMA's Administrative Boundaries
Apache License 2.0
16 stars 4 forks source link

wrong polygonize on simplepolys #13

Open paulopires16 opened 6 years ago

paulopires16 commented 6 years ago

Hello,

"simplifyLayerPreserveTopology": The polygonize on simplepolys table is wrong... lost one rig?

Please see this example:

DROP TABLE IF EXISTS areas; CREATE TABLE areas ( id integer, geom GEOMETRY );

INSERT INTO areas (id, geom) VALUES (1, ST_GeometryFromText('POLYGON (( 152475.78309656942 348633.83643648896 100.0 , 152819.11124438787 348634.30014856393 100.0 , 152813.0950157867 348346.43594807677 100.0 , 151948.4678701025 348359.31090193643 100.0 , 151945.74402745243 348463.90645969921 100.0 , 152474.91289439827 348458.49244305107 100.0 , 152475.78309656942 348633.83643648896 100.0 ), ( 152527.33647845959 348558.83199005033 100.0 , 152529.2307245445 348407.29230325681 100.0 , 152709.18410261182 348403.50381108694 100.0 , 152709.18410261182 348558.83199005033 100.0 , 152527.33647845959 348558.83199005033 100.0 ), ( 152006.95163549151 348435.14978348627 100.0 , 152006.95163549151 348385.89938685647 100.0 , 152092.19270658147 348384.00514083228 100.0 , 152091.24558356937 348434.20266047411 100.0 , 152006.95163549151 348435.14978348627 100.0 ))')), (2, ST_GeometryFromText('POLYGON (( 152527.33647845959 348558.83199005033 100.0 , 152709.18410261182 348558.83199005033 100.0 , 152709.18410261182 348403.50381108694 100.0 , 152529.22480595027 348407.76579079556 100.0 , 152527.33647845959 348558.83199005033 100.0 ))')) ;

DROP TABLE IF EXISTS poly2line; create table poly2line as SELECT ST_Boundary((ST_Dump(geom)).geom) AS geom FROM areas;

DROP TABLE IF EXISTS polygonize; CREATE TABLE polygonize AS select (st_dump(ST_Polygonize(geom))).geom as geom from poly2line;

paulopires16 commented 6 years ago

found... just remove this line --create unlogged table gunion as select st_union(g) as g from rings; –