<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7654.12">
<TITLE>RE: [geos-devel] question about GEOSUnion?</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>LiN YongHeng,<BR>
<BR>
Its best to change the subject line if you must reply to a digest and cut out all non-relevant stuff.<BR>
<BR>
Now getting back to your question.&nbsp; I don't use GEOS directly but thru PostGIS, but I presume it behaves the same.<BR>
<BR>
1) There is no such thing as LINE.&nbsp; If I try that I get invalid geometry, but maybe GEOS doesn't validate that and function then does somethig strange with it.<BR>
<BR>
It should be<BR>
LINESTRING(1 3,1 6)<BR>
<BR>
2) When I do Envelope of LINESTRING(1 3, 3 6)<BR>
<BR>
I get<BR>
LINESTRING(1 3,1 6)<BR>
<BR>
3) Which version of GEOS are you using?<BR>
<BR>
Hope that helps,<BR>
Regina<BR>
-----Original Message-----<BR>
From: geos-devel-bounces@lists.osgeo.org on behalf of LiN YongHeng<BR>
Sent: Mon 4/13/2009 9:31 PM<BR>
To: geos-devel@lists.osgeo.org<BR>
Subject: [geos-devel] Re: geos-devel Digest, Vol 78, Issue 10<BR>
<BR>
Hello,everyone,<BR>
If you say that my geometry is invalid, it means that GeosEnvelop return a<BR>
invalid geometry. I use the<BR>
GeosEnvelop(&quot;LINE(1 3,1 6)&quot;) and it return the geometry like<BR>
GEOSGeom g2 = &quot;POLYGON ((1&nbsp; 3, 1&nbsp; 3, 1&nbsp; 6, 1&nbsp; 6, 1 3))&quot;.<BR>
After I use the GEOSUnion, it give me result like &quot;GEOMETRYCOLLECTION<BR>
EMPTY&quot;.&nbsp; Does anyone can<BR>
tell me how to do that?<BR>
2009/4/14 &lt;geos-devel-request@lists.osgeo.org&gt;<BR>
<BR>
&gt; Message: 1<BR>
&gt; Date: Mon, 13 Apr 2009 09:17:11 +0800<BR>
&gt; From: LiN YongHeng &lt;bicealyh@gmail.com&gt;<BR>
&gt; Subject: [geos-devel] question about GEOSUnion?<BR>
&gt; To: geos-devel@lists.osgeo.org<BR>
&gt; Message-ID:<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;11e4f1140904121817o3acb3f0eo5c0203551d6b9cdc@mail.gmail.com&gt;<BR>
&gt; Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<BR>
&gt;<BR>
&gt; Hello everyone,<BR>
&gt; I have a question about GEOSUnion().<BR>
&gt; I give value to g1 and g2 like below:<BR>
&gt; GEOSGeom g1 = &quot;POLYGON ((1&nbsp; 3, 1&nbsp; 3, 1&nbsp; 6, 1&nbsp; 6, 1 3))&quot;&nbsp; and GEOSGeom g2 =<BR>
&gt; &quot;POLYGON ((1&nbsp; 3, 1&nbsp; 3, 1&nbsp; 6, 1&nbsp; 6, 1 3))&quot;&nbsp; , but if I make union operation<BR>
&gt; like GEOSGeom g3 =<BR>
&gt; GEOSUnion(g1, g2), it give me result like &quot;GEOMETRYCOLLECTION EMPTY&quot;.<BR>
&gt; Does anyone can tell me why?<BR>
&gt; -------------- next part --------------<BR>
&gt; An HTML attachment was scrubbed...<BR>
&gt; URL:<BR>
&gt; <A HREF="http://lists.osgeo.org/pipermail/geos-devel/attachments/20090413/38a437e5/attachment-0001.html">http://lists.osgeo.org/pipermail/geos-devel/attachments/20090413/38a437e5/attachment-0001.html</A><BR>
&gt;<BR>
&gt; ------------------------------<BR>
&gt;<BR>
&gt; Message: 2<BR>
&gt; Date: Mon, 13 Apr 2009 01:32:38 -0400<BR>
&gt; From: &quot;Obe, Regina&quot; &lt;robe.dnd@cityofboston.gov&gt;<BR>
&gt; Subject: RE: [geos-devel] question about GEOSUnion?<BR>
&gt; To: &quot;GEOS Development List&quot; &lt;geos-devel@lists.osgeo.org&gt;<BR>
&gt; Message-ID:<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;53F9CF533E1AA14EA1F8C5C08ABC08D204D7F27F@ZDND.DND.boston.cob&gt;<BR>
&gt; Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<BR>
&gt;<BR>
&gt; LiN YongHeng,<BR>
&gt;<BR>
&gt; your geometry is invalid since first you don't have enough points to form a<BR>
&gt; polygon after you remove the dupes and second you have self intersections.<BR>
&gt;&nbsp; Therefore the union is undefined at best.<BR>
&gt;<BR>
&gt; Hope that helps,<BR>
&gt; Regina<BR>
&gt;<BR>
&gt;<BR>
&gt; -----Original Message-----<BR>
&gt; From: geos-devel-bounces@lists.osgeo.org on behalf of LiN YongHeng<BR>
&gt; Sent: Sun 4/12/2009 9:17 PM<BR>
&gt; To: geos-devel@lists.osgeo.org<BR>
&gt; Subject: [geos-devel] question about GEOSUnion?<BR>
&gt;<BR>
&gt; Hello everyone,<BR>
&gt; I have a question about GEOSUnion().<BR>
&gt; I give value to g1 and g2 like below:<BR>
&gt; GEOSGeom g1 = &quot;POLYGON ((1&nbsp; 3, 1&nbsp; 3, 1&nbsp; 6, 1&nbsp; 6, 1 3))&quot;&nbsp; and GEOSGeom g2 =<BR>
&gt; &quot;POLYGON ((1&nbsp; 3, 1&nbsp; 3, 1&nbsp; 6, 1&nbsp; 6, 1 3))&quot;&nbsp; , but if I make union operation<BR>
&gt; like GEOSGeom g3 =<BR>
&gt; GEOSUnion(g1, g2), it give me result like &quot;GEOMETRYCOLLECTION EMPTY&quot;.<BR>
&gt; Does anyone can tell me why?<BR>
&gt;<BR>
&gt;<BR>
&gt;<BR>
&gt; -----------------------------------------<BR>
&gt; The substance of this message, including any attachments, may be<BR>
&gt; confidential, legally privileged and/or exempt from disclosure<BR>
&gt; pursuant to Massachusetts law. It is intended<BR>
&gt; solely for the addressee. If you received this in error, please<BR>
&gt; contact the sender and delete the material from any computer.<BR>
&gt; -------------- next part --------------<BR>
&gt; An HTML attachment was scrubbed...<BR>
&gt; URL:<BR>
&gt; <A HREF="http://lists.osgeo.org/pipermail/geos-devel/attachments/20090413/dddedf6a/attachment-0001.html">http://lists.osgeo.org/pipermail/geos-devel/attachments/20090413/dddedf6a/attachment-0001.html</A><BR>
&gt;<BR>
&gt; ------------------------------<BR>
&gt;<BR>
&gt; Message: 3<BR>
&gt; Date: Mon, 13 Apr 2009 10:16:41 +0100<BR>
&gt; From: Mateusz Loskot &lt;mateusz@loskot.net&gt;<BR>
&gt; Subject: Re: [geos-devel] question about GEOSUnion?<BR>
&gt; To: GEOS Development List &lt;geos-devel@lists.osgeo.org&gt;<BR>
&gt; Message-ID: &lt;49E302F9.2000008@loskot.net&gt;<BR>
&gt; Content-Type: text/plain; charset=ISO-8859-1<BR>
&gt;<BR>
&gt; LiN YongHeng wrote:<BR>
&gt; &gt; Hello everyone, I have a question about GEOSUnion(). I give value to<BR>
&gt; &gt; g1 and g2 like below: GEOSGeom g1 = &quot;POLYGON ((1&nbsp; 3, 1&nbsp; 3, 1&nbsp; 6, 1 6,<BR>
&gt; &gt; 1 3))&quot;&nbsp; and GEOSGeom g2 = &quot;POLYGON ((1&nbsp; 3, 1&nbsp; 3, 1&nbsp; 6, 1&nbsp; 6, 1 3))&quot;<BR>
&gt; &gt; , but if I make union operation like GEOSGeom g3 = GEOSUnion(g1, g2),<BR>
&gt; &gt; it give me result like &quot;GEOMETRYCOLLECTION EMPTY&quot;. Does anyone can<BR>
&gt; &gt; tell me why?<BR>
&gt;<BR>
&gt; LiN YongHeng,<BR>
&gt;<BR>
&gt; In order to be able to use GEOS or PostGIS, you need to read and<BR>
&gt; understand some basic informations included in the OGC Simple Feature<BR>
&gt; Specification<BR>
&gt;<BR>
&gt; <A HREF="http://www.opengeospatial.org/standards/sfs">http://www.opengeospatial.org/standards/sfs</A><BR>
&gt;<BR>
&gt; Otherwise, you will be hit the wall when you try to use every function.<BR>
&gt;<BR>
&gt; Best regards,<BR>
&gt; --<BR>
&gt; Mateusz Loskot, <A HREF="http://mateusz.loskot.net">http://mateusz.loskot.net</A><BR>
&gt; Charter Member of OSGeo, <A HREF="http://osgeo.org">http://osgeo.org</A><BR>
&gt;<BR>
&gt;<BR>
&gt; ------------------------------<BR>
&gt;<BR>
&gt; _______________________________________________<BR>
&gt; geos-devel mailing list<BR>
&gt; geos-devel@lists.osgeo.org<BR>
&gt; <A HREF="http://lists.osgeo.org/mailman/listinfo/geos-devel">http://lists.osgeo.org/mailman/listinfo/geos-devel</A><BR>
&gt;<BR>
&gt; End of geos-devel Digest, Vol 78, Issue 10<BR>
&gt; ******************************************<BR>
&gt;<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>