[postgis-users] Intersection errors

Sean M. Montague smontague at ATSDenver.com
Mon Jun 6 11:35:01 PDT 2005


Several months ago I had posted on this list about some intersection
problems I was having, but was never able to solve it.  I gave up with
the intentions of revisiting it if version 1 did not fix the bug.  It
has not.  The problem arises when trying to intersect one poly with
another when it has holes.  If the intersecting poly partially overlays
a hole, it throws an error.  Below is the geometry with holes and the
two intersection statements.  The first works, it does not intersect any
part of the hole.  The second fails.  I've tried to keep it simple.
Thanks.

Sean


GeometryFromText('MULTIPOLYGON(((-244339 1210399, -244339 1541250, 21058
1541250, 21058 1210399, -244339 1210399)),((-39283 1521307, -57692
1518238, -64340 1511591, -62805 1497784, -54112 1494716, -45931 1494716,
-40306 1494204, -38260 1493693, -34681 1482443, -42862 1471705, -50021
1460966, -51044 1448182, -41840 1437955, -27522 1431307, -8601 1422614,
603 1409318, 92 1392955, -13715 1377103, -46953 1370455, -68942 1365341,
-91442 1342841, -91442 1309092, -81726 1303467, -2976 1329546, 13899
1358182, 14921 1431818, -7067 1513125, -39283 1521307)))',32767)

SELECT intersection(the_geom, PolygonFromText('POLYGON((-341457 1496785,
-161897 1496785, -161897 1317225, -341457 1317225, -341457
1496785))',32767))
As the_geom
>From test_02
WHERE layer='3'
AND the_geom && PolygonFromText('POLYGON((-341457 1496785, -161897
1496785, -161897 1317225, -341457 1317225, -341457 1496785))',32767);

Returns:
"0103000020FF7F000001000000050000000000000098D30DC1000000006919344100000
00098D30DC100000000D1D636410000000048C303C100000000D1D636410000000048C30
3C100000000691934410000000098D30DC10000000069193441"



SELECT intersection(the_geom, PolygonFromText('POLYGON((-213394 1467529,
-33834 1467529, -33834 1287969, -213394 1287969, -213394
1467529))',32767))
As the_geom
>From test_02
WHERE layer='3'
AND the_geom && PolygonFromText('POLYGON((-213394 1467529, -33834
1467529, -33834 1287969, -213394 1287969, -213394 1467529))',32767);

Returns:
NOTICE:  AssertionFailedException: EdgeRing::computePoints: found null
Directed Edge

ERROR:  GEOS Intersection() threw an error!



More information about the postgis-users mailing list