<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16525" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2><FONT color=#000000 size=2>
<P>I found what I think to be a bug in the Intersection routine.&nbsp;</P>
<P>I defined a polygon with the following wkt: POLYGON( (0 0, 1 0, 1 1, 0 1, 0 
0), (.5 .1, 1 .5, .5 .9, .5 .1))&nbsp; This polygon has an exterior ring that is 
a square, and one interior ring that is a triangle.&nbsp; The interior ring 
touches the exterior ring in one point.&nbsp; I believe this is considered a 
valid polygon.</P>
<P>When I call the <FONT size=2>GEOSIntersection method using this polygon for 
both parameters, I would expect to get back the same polygon.&nbsp; Instead I 
get back a geometry collection of 8 linestrings and a polygon:</FONT></P><FONT 
size=2>
<P>GEOMETRYCOLLECTION (LINESTRING (0.0000000000000000 0.0000000000000000, 
1.0000000000000000 0.0000000000000000), LINESTRING (1.0000000000000000 
0.0000000000000000, 1.0000000000000000 0.5000000000000000), LINESTRING 
(1.0000000000000000 0.5000000000000000, 1.0000000000000000 1.0000000000000000), 
LINESTRING (1.0000000000000000 1.0000000000000000, 0.0000000000000000 
1.0000000000000000), LINESTRING (0.0000000000000000 1.0000000000000000, 
0.0000000000000000 0.0000000000000000), LINESTRING (0.5000000000000000 
0.1000000000000000, 1.0000000000000000 0.5000000000000000), LINESTRING 
(1.0000000000000000 0.5000000000000000, 0.5000000000000000 0.9000000000000000), 
LINESTRING (0.5000000000000000 0.9000000000000000, 0.5000000000000000 
0.1000000000000000), POLYGON ((1.0000000000000000 0.0000000000000000, 
0.0000000000000000 0.0000000000000000, 0.0000000000000000 1.0000000000000000, 
1.0000000000000000 1.0000000000000000, 1.0000000000000000 0.5000000000000000, 
1.0000000000000000 0.0000000000000000), (1.0000000000000000 0.5000000000000000, 
0.5000000000000000 0.9000000000000000, 0.5000000000000000 0.1000000000000000, 
1.0000000000000000 0.5000000000000000)))</P></FONT>
<P><FONT size=2>The last polygon appears to be equivalent to my input, but with 
one extra point in the exterior ring.&nbsp; The 8 linestrings appear to be the 
pieces of the </FONT><FONT size=2>boundary of the polygon.</FONT></P>
<P><FONT size=2>I believe this is a bug. If I change the input polygon so that 
the interior ring doesn't touch the exterior ring, I get the expected 
result.</FONT></P>
<P><FONT size=2>Thanks,</FONT></P>
<P><FONT size=2>Pete 
Gerritson</P></FONT></FONT></FONT></DIV></FONT></DIV></BODY></HTML>