Opened 11 years ago
Closed 3 years ago
#2398 closed defect (fixed)
geom---> topogeom failing on imbricated polygon for a given precision
Reported by: | RemiC | Owned by: | strk |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS GEOS |
Component: | topology | Version: | 2.0.x |
Keywords: | topology geos totopogeom polygon areal precision | Cc: |
Description
This bug occurs when trying to convert 4 polygons into topogeom. The geometries are valid according to postgis & qgis, they intersects but don't overlap. It seems to be related to precision, as a very small precision gives no bug.
postgis_full_version() : "POSTGIS="2.0.3 r11128" GEOS="3.3.8-CAPI-1.7.8" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.10.0, released 2013/04/24" LIBXML="2.8.0" TOPOLOGY RASTER"
I boiled it to a very simple example (4 geometries), I put a qgis screen as attachment :
I get an error : "ERROR: Spatial exception - geometry intersects edge 1" .
Here is a simple sql code to re-enact the bug :
——
—demo of bug for the conversion to topogeom
—Building a minimal table with geometry
—creating table DROP TABLE IF EXISTS public.test_for_failing_import; CREATE TABLE public.test_for_failing_import ( id integer,
geom geometry(MultiPolygonZM,0) );
—filling it INSERT INTO public.test_for_failing_import VALUES
(613,'01060000E0C0340E000100000001030000C0010000002C000000000000009BE5234100000020312D5A41CDCCCCCCCC4C40400000000000000000000000009BE5234166666606312D5A41CDCCCCCCCC4C40400000000000000000CDCCCCCC9AE52341333333F3302D5A41333333333373404000000000000000009A9999999AE52341000000E0302D5A4133333333337340400000000000000000000000009AE52341666666C6302D5A41333333333373404000000000000000009A99999999E52341333333B3302D5A41333333333373404000000000000000003333333399E52341000000A0302D5A41333333333373404000000000000000009A99999998E5234133333393302D5A41333333333373404000000000000000000000000098E5234100000080302D5A41333333333373404000000000000000003333333397E523419A999979302D5A41333333333373404000000000000000006666666696E52341CDCCCC6C302D5A41666666666666404000000000000000009A99999995E52341CDCCCC6C302D5A41666666666666404000000000000000000000000095E52341CDCCCC6C302D5A41666666666666404000000000000000003333333394E52341CDCCCC6C302D5A41666666666666404000000000000000006666666693E5234133333373302D5A4166666666666640400000000000000000CDCCCCCC92E523419A999979302D5A4166666666666640400000000000000000CDCCCCCC91E52341CDCCCC8C302D5A41666666666666404000000000000000003333333391E523419A999999302D5A4166666666666640400000000000000000CDCCCCCC90E52341CDCCCCAC302D5A419A9999999959404000000000000000003333333390E52341333333D3302D5A419A9999999959404000000000000000000000000090E52341CDCCCCEC302D5A41CDCCCCCCCC4C40400000000000000000CDCCCCCC8FE5234166666606312D5A419A99999999993F400000000000000000CDCCCCCC8FE5234100000020312D5A419A99999999993F400000000000000000CDCCCCCC8FE523419A999939312D5A419A99999999993F4000000000000000000000000090E5234133333353312D5A41666666666626404000000000000000003333333390E5234166666666312D5A41666666666626404000000000000000000000000091E52341CDCCCC8C312D5A41666666666626404000000000000000006666666691E52341000000A0312D5A41666666666626404000000000000000000000000092E52341CDCCCCAC312D5A419A9999999919404000000000000000000000000093E52341000000C0312D5A41666666666626404000000000000000009A99999993E52341666666C6312D5A419A9999999919404000000000000000006666666694E52341CDCCCCCC312D5A419A9999999919404000000000000000003333333395E52341333333D3312D5A4166666666662640400000000000000000CDCCCCCC95E52341CDCCCCCC312D5A41666666666626404000000000000000009A99999996E52341CDCCCCCC312D5A41666666666626404000000000000000006666666697E52341666666C6312D5A41666666666626404000000000000000003333333398E523419A9999B9312D5A4133333333333340400000000000000000CDCCCCCC98E52341666666A6312D5A41333333333333404000000000000000006666666699E523419A999999312D5A4133333333333340400000000000000000CDCCCCCC99E5234166666686312D5A4100000000004040400000000000000000333333339AE5234133333373312D5A41000000000040404000000000000000009A9999999AE523419A999959312D5A4100000000004040400000000000000000000000009BE5234133333333312D5A4100000000004040400000000000000000000000009BE5234100000020312D5A41CDCCCCCCCC4C40400000000000000000'), (614,'01060000E0C0340E000100000001030000C002000000160000003333333381E5234166666686312D5A419A99999999194C400000000000000000333333337DE5234133333393312D5A410000000000C04C400000000000000000CDCCCCCC7AE52341CDCCCC8C312D5A410000000000C04C4000000000000000006666666678E5234100000040312D5A410000000000C04C4000000000000000006666666676E5234100000040312D5A410000000000C04C4000000000000000003333333374E52341CDCCCC4C312D5A410000000000C04C4000000000000000009A99999972E52341000000A0312D5A410000000000C04C4000000000000000006666666672E52341CDCCCCEC312D5A419A99999999D94C4000000000000000000000000075E5234166666646322D5A41CDCCCCCCCC0C4D4000000000000000003333333374E52341000000A0322D5A419A99999999194D400000000000000000CDCCCCCC73E52341333333F3322D5A413333333333334D4000000000000000009A99999973E5234133333353332D5A419A99999999194E4000000000000000003333333376E523419A999999332D5A419A99999999194E4000000000000000009A99999978E52341000000C0332D5A419A99999999194E4000000000000000009A9999997BE52341CDCCCCCC332D5A419A99999999194E400000000000000000000000007FE52341CDCCCCCC332D5A41CDCCCCCCCC0C4E4000000000000000006666666682E52341666666C6332D5A410000000000004E4000000000000000009A99999984E5234133333373332D5A413333333333F34D4000000000000000009A99999985E5234166666626332D5A413333333333F34D4000000000000000000000000086E52341000000A0322D5A419A99999999D94D4000000000000000000000000084E5234133333333322D5A41CDCCCCCCCCCC4D4000000000000000003333333381E5234166666686312D5A419A99999999194C40000000000000000027000000CDCCCCCC81E52341666666C6322D5A413333333333333F400000000000000000CDCCCCCC81E52341CDCCCCEC322D5A413333333333333F4000000000000000009A99999981E5234100000000332D5A413333333333333F4000000000000000003333333381E5234133333313332D5A413333333333333F4000000000000000000000000081E5234166666626332D5A419A99999999193F4000000000000000006666666680E523419A999939332D5A419A99999999193F400000000000000000333333337FE5234133333353332D5A419A99999999193F4000000000000000009A9999997EE5234100000060332D5A419A99999999193F400000000000000000CDCCCCCC7DE5234166666666332D5A419A99999999193F400000000000000000333333337DE52341CDCCCC6C332D5A419A99999999193F400000000000000000666666667CE52341CDCCCC6C332D5A419A99999999193F400000000000000000333333337BE5234166666666332D5A413333333333333F4000000000000000009A9999997AE5234100000060332D5A413333333333333F4000000000000000009A99999979E52341CDCCCC4C332D5A413333333333333F4000000000000000009A99999978E5234133333333332D5A413333333333333F4000000000000000003333333378E5234100000020332D5A413333333333333F4000000000000000000000000078E52341CDCCCC0C332D5A413333333333333F4000000000000000009A99999977E52341333333F3322D5A413333333333333F4000000000000000009A99999977E52341000000E0322D5A413333333333333F4000000000000000006666666677E52341666666C6322D5A41CDCCCCCCCC4C3F4000000000000000009A99999977E52341CDCCCCAC322D5A41CDCCCCCCCC4C3F4000000000000000009A99999977E5234133333393322D5A41CDCCCCCCCC4C3F4000000000000000000000000078E5234100000080322D5A41CDCCCCCCCC4C3F4000000000000000003333333378E52341CDCCCC6C322D5A41CDCCCCCCCC4C3F4000000000000000003333333379E52341CDCCCC4C322D5A41CDCCCCCCCC4C3F4000000000000000009A9999997AE52341CDCCCC2C322D5A41CDCCCCCCCC4C3F400000000000000000CDCCCCCC7BE5234100000020322D5A41CDCCCCCCCC4C3F400000000000000000666666667CE5234100000020322D5A41CDCCCCCCCC4C3F400000000000000000333333337DE5234100000020322D5A41CDCCCCCCCC4C3F400000000000000000CDCCCCCC7DE5234166666626322D5A41CDCCCCCCCC4C3F4000000000000000009A9999997EE52341CDCCCC2C322D5A41CDCCCCCCCC4C3F400000000000000000333333337FE5234133333333322D5A41CDCCCCCCCC4C3F4000000000000000000000000080E5234100000040322D5A41CDCCCCCCCC4C3F4000000000000000006666666680E5234133333353322D5A41CDCCCCCCCC4C3F4000000000000000000000000081E5234166666666322D5A41CDCCCCCCCC4C3F4000000000000000003333333381E523419A999979322D5A41CDCCCCCCCC4C3F4000000000000000009A99999981E52341CDCCCC8C322D5A413333333333333F400000000000000000CDCCCCCC81E52341000000A0322D5A413333333333333F400000000000000000CDCCCCCC81E52341666666C6322D5A413333333333333F400000000000000000'), (615,'01060000E0C0340E000100000001030000C00200000012000000666666669CE5234133333373302D5A416666666666664D400000000000000000666666669AE5234166666606302D5A413333333333B34C4000000000000000003333333397E523419A9999D92F2D5A413333333333B34C400000000000000000CDCCCCCC93E52341CDCCCCCC2F2D5A413333333333B34C400000000000000000CDCCCCCC8FE52341CDCCCC0C302D5A413333333333B34C4000000000000000009A9999998DE5234100000060302D5A413333333333B34C400000000000000000666666668BE52341666666E6302D5A413333333333F34B400000000000000000000000008DE52341CDCCCCAC312D5A416666666666664D400000000000000000000000008FE523419A999919322D5A416666666666664D4000000000000000009A99999991E5234166666646322D5A413333333333734D4000000000000000006666666694E5234133333353322D5A413333333333734D4000000000000000006666666697E5234133333353322D5A413333333333734D400000000000000000333333339AE52341CDCCCC2C322D5A413333333333734D400000000000000000CDCCCCCC9CE523419A9999D9312D5A413333333333734D4000000000000000009A9999999DE5234100000080312D5A413333333333734D4000000000000000009A9999999DE5234133333313312D5A416666666666664D4000000000000000009A9999999CE52341CDCCCCAC302D5A416666666666664D400000000000000000666666669CE5234133333373302D5A416666666666664D4000000000000000002C000000000000009BE5234100000020312D5A41CDCCCCCCCC4C40400000000000000000000000009BE5234133333333312D5A41000000000040404000000000000000009A9999999AE523419A999959312D5A4100000000004040400000000000000000333333339AE5234133333373312D5A4100000000004040400000000000000000CDCCCCCC99E5234166666686312D5A41000000000040404000000000000000006666666699E523419A999999312D5A4133333333333340400000000000000000CDCCCCCC98E52341666666A6312D5A41333333333333404000000000000000003333333398E523419A9999B9312D5A41333333333333404000000000000000006666666697E52341666666C6312D5A41666666666626404000000000000000009A99999996E52341CDCCCCCC312D5A4166666666662640400000000000000000CDCCCCCC95E52341CDCCCCCC312D5A41666666666626404000000000000000003333333395E52341333333D3312D5A41666666666626404000000000000000006666666694E52341CDCCCCCC312D5A419A9999999919404000000000000000009A99999993E52341666666C6312D5A419A9999999919404000000000000000000000000093E52341000000C0312D5A41666666666626404000000000000000000000000092E52341CDCCCCAC312D5A419A9999999919404000000000000000006666666691E52341000000A0312D5A41666666666626404000000000000000000000000091E52341CDCCCC8C312D5A41666666666626404000000000000000003333333390E5234166666666312D5A41666666666626404000000000000000000000000090E5234133333353312D5A4166666666662640400000000000000000CDCCCCCC8FE523419A999939312D5A419A99999999993F400000000000000000CDCCCCCC8FE5234100000020312D5A419A99999999993F400000000000000000CDCCCCCC8FE5234166666606312D5A419A99999999993F4000000000000000000000000090E52341CDCCCCEC302D5A41CDCCCCCCCC4C404000000000000000003333333390E52341333333D3302D5A419A999999995940400000000000000000CDCCCCCC90E52341CDCCCCAC302D5A419A9999999959404000000000000000003333333391E523419A999999302D5A4166666666666640400000000000000000CDCCCCCC91E52341CDCCCC8C302D5A4166666666666640400000000000000000CDCCCCCC92E523419A999979302D5A41666666666666404000000000000000006666666693E5234133333373302D5A41666666666666404000000000000000003333333394E52341CDCCCC6C302D5A41666666666666404000000000000000000000000095E52341CDCCCC6C302D5A41666666666666404000000000000000009A99999995E52341CDCCCC6C302D5A41666666666666404000000000000000006666666696E52341CDCCCC6C302D5A41666666666666404000000000000000003333333397E523419A999979302D5A41333333333373404000000000000000000000000098E5234100000080302D5A41333333333373404000000000000000009A99999998E5234133333393302D5A41333333333373404000000000000000003333333399E52341000000A0302D5A41333333333373404000000000000000009A99999999E52341333333B3302D5A4133333333337340400000000000000000000000009AE52341666666C6302D5A41333333333373404000000000000000009A9999999AE52341000000E0302D5A4133333333337340400000000000000000CDCCCCCC9AE52341333333F3302D5A4133333333337340400000000000000000000000009BE5234166666606312D5A41CDCCCCCCCC4C40400000000000000000000000009BE5234100000020312D5A41CDCCCCCCCC4C40400000000000000000'), (616,'01060000E0C0340E000100000001030000C0010000000C0000006666666624E5234133333373152D5A41CDCCCCCCCC8C49400000000000000000CDCCCCCC30E523419A999919182D5A413333333333B3494000000000000000006666666666E5234100000060142D5A41CDCCCCCCCC8C4F400000000000000000666666666EE523419A999979132D5A41CDCCCCCCCC8C4F400000000000000000CDCCCCCC70E52341333333B3122D5A41CDCCCCCCCC8C4F400000000000000000CDCCCCCC6FE52341000000E0112D5A41CDCCCCCCCC8C4F4000000000000000009A9999996CE5234166666646112D5A41CDCCCCCCCC8C4F4000000000000000009A99999967E52341000000E0102D5A41CDCCCCCCCC8C4F4000000000000000003333333362E52341000000E0102D5A41CDCCCCCCCC8C4F4000000000000000009A9999995DE52341666666E6102D5A41CDCCCCCCCC8C4F4000000000000000003333333358E5234133333353112D5A41CDCCCCCCCC8C4F4000000000000000006666666624E5234133333373152D5A41CDCCCCCCCC8C49400000000000000000');
—creating a topo schema
—create topo schema SELECT CreateTopology('test_for_failing_import_schema',0,0.1,true);
—creating a table to store topogreometry
DROP TABLE IF EXISTS test_for_failing_import_schema.failing_import ; CREATE TABLE test_for_failing_import_schema.failing_import (gid SERIAL PRIMARY KEY, id text );
—— —Adding a topogeometry column SELECT AddTopoGeometryColumn('test_for_failing_import_schema','test_for_failing_import_schema','failing_import','g','POLYGON');
—trying to convert geometry to topogeometry
INSERT INTO test_for_failing_import_schema.failing_import (id, g) SELECT id AS id, toTopoGeom(source.geom,'test_for_failing_import_schema',1,0.5) FROM public.test_for_failing_import as source ORDER BY id ASC
Attachments (2)
Change History (5)
by , 11 years ago
Attachment: | error_for_strk_2.png added |
---|
by , 11 years ago
Attachment: | error_convert_to_topogeom.sql added |
---|
The sql script to re-enact the error
comment:1 by , 11 years ago
EDIT : there is no bug when using the latest (31/07/2013) GEOS 3.4Dev version. Rémi-C
comment:2 by , 11 years ago
Milestone: | PostGIS 2.1.0 → PostGIS GEOS |
---|
comment:3 by , 3 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Given last comment reports the bug was fixed in geos, I'm closing this
A QGis screen of the polygons