Thanks a lot all for your replies!<br>It turns out that there was no problem with the geometry itself, but with another geometry that I generated from it; this second geometry was *empty*, but not *null* and so I was failing a test to catch it that would turn it out to my first (correct) geometry. <br>
                                                 Thanks again for your time and have a good evening!<br>                                                                             Jo<br><br><div class="gmail_quote">2009/8/2  <span dir="ltr">&lt;<a href="mailto:geos-devel-request@lists.osgeo.org">geos-devel-request@lists.osgeo.org</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Send geos-devel mailing list submissions to<br>
        <a href="mailto:geos-devel@lists.osgeo.org">geos-devel@lists.osgeo.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="http://lists.osgeo.org/mailman/listinfo/geos-devel" target="_blank">http://lists.osgeo.org/mailman/listinfo/geos-devel</a><br>
or, via email, send a message with subject or body &#39;help&#39; to<br>
        <a href="mailto:geos-devel-request@lists.osgeo.org">geos-devel-request@lists.osgeo.org</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:geos-devel-owner@lists.osgeo.org">geos-devel-owner@lists.osgeo.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than &quot;Re: Contents of geos-devel digest...&quot;<br>
<br>
<br>
Today&#39;s Topics:<br>
<br>
   1. Re: (Mateusz Loskot)<br>
   2. Re:(not) Empty geometry (Jo)<br>
   3. Re: Re:(not) Empty geometry (Mateusz Loskot)<br>
   4. Re: (not) Empty geometry (Jo) (Jo)<br>
   5. Re: Re: (not) Empty geometry (Jo) (Mateusz Loskot)<br>
   6. Polygonizer returns inner rings on their own? (Frederik Ramm)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Sun, 02 Aug 2009 21:57:47 +0100<br>
From: Mateusz Loskot &lt;<a href="mailto:mateusz@loskot.net">mateusz@loskot.net</a>&gt;<br>
Subject: Re: [geos-devel] (not) Empty geometry<br>
To: GEOS Development List &lt;<a href="mailto:geos-devel@lists.osgeo.org">geos-devel@lists.osgeo.org</a>&gt;<br>
Message-ID: &lt;<a href="mailto:4A75FDCB.4020104@loskot.net">4A75FDCB.4020104@loskot.net</a>&gt;<br>
Content-Type: text/plain; charset=ISO-8859-1<br>
<br>
Jo wrote:<br>
&gt; Hi, I am having some troubles with a polygon, that is seen by geos as<br>
&gt; empty (and thus returning GetNumPoints()=0);<br>
&gt; I dont understand what might be wrong with this polygon, since the<br>
&gt; output of geos::io::WKTWriter shows a polygon with many<br>
&gt; coordinates...<br>
<br>
It&#39;s impossible to judge unless you show a snippet of code<br>
that presents how you construct a polygon object using GEOS?<br>
What&#39;s the source data?<br>
<br>
Best regards,<br>
--<br>
Mateusz Loskot, <a href="http://mateusz.loskot.net" target="_blank">http://mateusz.loskot.net</a><br>
Charter Member of OSGeo, <a href="http://osgeo.org" target="_blank">http://osgeo.org</a><br>
<br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Sun, 2 Aug 2009 22:16:29 +0100<br>
From: Jo &lt;<a href="mailto:doublebyte@gmail.com">doublebyte@gmail.com</a>&gt;<br>
Subject: [geos-devel] Re:(not) Empty geometry<br>
To: <a href="mailto:geos-devel@lists.osgeo.org">geos-devel@lists.osgeo.org</a><br>
Message-ID:<br>
        &lt;<a href="mailto:23ab5f0a0908021416g27919536o256fd515f79acacc@mail.gmail.com">23ab5f0a0908021416g27919536o256fd515f79acacc@mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<br>
<br>
I just realized the mailing list truncated my last message; here it is<br>
(without the attach!)<br>
<br>
Hi,<br>
I am having some troubles with a polygon, that is seen by geos as empty (and<br>
thus returning GetNumPoints()=0); I dont understand what might be wrong with<br>
this polygon, since the output of geos::io::WKTWriter shows a polygon with<br>
many coordinates... I append that output here;<br>
I also put an image of the polygon on:<br>
<br>
<a href="http://ladybug.no-ip.org/files/emptyPolygon.png" target="_blank">http://ladybug.no-ip.org/files/emptyPolygon.png</a><br>
<br>
It would be great if anybody had some suggestions: Im realy lost here!<br>
Thanks in advance for ur help,<br>
<br>
cheers,<br>
<br>
Jo<br>
<br>
<br>
2009/8/2 &lt;<a href="mailto:geos-devel-request@lists.osgeo.org">geos-devel-request@lists.osgeo.org</a>&gt;<br>
<br>
&gt; Send geos-devel mailing list submissions to<br>
&gt;        <a href="mailto:geos-devel@lists.osgeo.org">geos-devel@lists.osgeo.org</a><br>
&gt;<br>
&gt; To subscribe or unsubscribe via the World Wide Web, visit<br>
&gt;        <a href="http://lists.osgeo.org/mailman/listinfo/geos-devel" target="_blank">http://lists.osgeo.org/mailman/listinfo/geos-devel</a><br>
&gt; or, via email, send a message with subject or body &#39;help&#39; to<br>
&gt;        <a href="mailto:geos-devel-request@lists.osgeo.org">geos-devel-request@lists.osgeo.org</a><br>
&gt;<br>
&gt; You can reach the person managing the list at<br>
&gt;        <a href="mailto:geos-devel-owner@lists.osgeo.org">geos-devel-owner@lists.osgeo.org</a><br>
&gt;<br>
&gt; When replying, please edit your Subject line so it is more specific<br>
&gt; than &quot;Re: Contents of geos-devel digest...&quot;<br>
&gt;<br>
&gt;<br>
&gt; Today&#39;s Topics:<br>
&gt;<br>
&gt;   1. (not) Empty geometry (Jo)<br>
&gt;<br>
&gt;<br>
&gt; ----------------------------------------------------------------------<br>
&gt;<br>
&gt; Message: 1<br>
&gt; Date: Sun, 2 Aug 2009 21:51:41 +0100<br>
&gt; From: Jo &lt;<a href="mailto:doublebyte@gmail.com">doublebyte@gmail.com</a>&gt;<br>
&gt; Subject: [geos-devel] (not) Empty geometry<br>
&gt; To: <a href="mailto:geos-devel@lists.osgeo.org">geos-devel@lists.osgeo.org</a><br>
&gt; Message-ID:<br>
&gt;        &lt;<a href="mailto:23ab5f0a0908021351w53233efehdb82784d0c7248aa@mail.gmail.com">23ab5f0a0908021351w53233efehdb82784d0c7248aa@mail.gmail.com</a>&gt;<br>
&gt; Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<br>
&gt;<br>
&gt; Skipped content of type multipart/alternative-------------- next part<br>
&gt; --------------<br>
&gt; A non-text attachment was scrubbed...<br>
&gt; Name: polygon.wkt<br>
&gt; Type: application/octet-stream<br>
&gt; Size: 51117 bytes<br>
&gt; Desc: not available<br>
&gt; Url :<br>
&gt; <a href="http://lists.osgeo.org/pipermail/geos-devel/attachments/20090802/9e51e147/polygon.obj" target="_blank">http://lists.osgeo.org/pipermail/geos-devel/attachments/20090802/9e51e147/polygon.obj</a><br>
&gt;<br>
&gt; ------------------------------<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; geos-devel mailing list<br>
&gt; <a href="mailto:geos-devel@lists.osgeo.org">geos-devel@lists.osgeo.org</a><br>
&gt; <a href="http://lists.osgeo.org/mailman/listinfo/geos-devel" target="_blank">http://lists.osgeo.org/mailman/listinfo/geos-devel</a><br>
&gt;<br>
&gt; End of geos-devel Digest, Vol 82, Issue 3<br>
&gt; *****************************************<br>
&gt;<br>
<br>
<br>
<br>
--<br>
&quot;#define QUESTION ((bb) || !(bb))&quot;  (Shakespeare)<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://lists.osgeo.org/pipermail/geos-devel/attachments/20090802/1c757e2c/attachment-0001.html" target="_blank">http://lists.osgeo.org/pipermail/geos-devel/attachments/20090802/1c757e2c/attachment-0001.html</a><br>

<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Sun, 02 Aug 2009 22:30:06 +0100<br>
From: Mateusz Loskot &lt;<a href="mailto:mateusz@loskot.net">mateusz@loskot.net</a>&gt;<br>
Subject: Re: [geos-devel] Re:(not) Empty geometry<br>
To: GEOS Development List &lt;<a href="mailto:geos-devel@lists.osgeo.org">geos-devel@lists.osgeo.org</a>&gt;<br>
Message-ID: &lt;<a href="mailto:4A76055E.1040308@loskot.net">4A76055E.1040308@loskot.net</a>&gt;<br>
Content-Type: text/plain; charset=ISO-8859-1<br>
<br>
Jo wrote:<br>
&gt; I just realized the mailing list truncated my last message; here it is<br>
&gt; (without the attach!)<br>
<br>
Sorry, I didn&#39;t see any source code in your message.<br>
See how it is archived:<br>
<br>
<a href="http://lists.osgeo.org/pipermail/geos-devel/2009-August/004293.html" target="_blank">http://lists.osgeo.org/pipermail/geos-devel/2009-August/004293.html</a><br>
<br>
Or you mean polygon.obj attachment?<br>
<br>
<a href="http://lists.osgeo.org/pipermail/geos-devel/attachments/20090802/9e51e147/polygon.obj" target="_blank">http://lists.osgeo.org/pipermail/geos-devel/attachments/20090802/9e51e147/polygon.obj</a><br>
<br>
Best regards,<br>
--<br>
Mateusz Loskot, <a href="http://mateusz.loskot.net" target="_blank">http://mateusz.loskot.net</a><br>
Charter Member of OSGeo, <a href="http://osgeo.org" target="_blank">http://osgeo.org</a><br>
<br>
<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Sun, 2 Aug 2009 22:56:43 +0100<br>
From: Jo &lt;<a href="mailto:doublebyte@gmail.com">doublebyte@gmail.com</a>&gt;<br>
Subject: [geos-devel] Re: (not) Empty geometry (Jo)<br>
To: <a href="mailto:geos-devel@lists.osgeo.org">geos-devel@lists.osgeo.org</a><br>
Message-ID:<br>
        &lt;<a href="mailto:23ab5f0a0908021456x3928293al32e4e1186dfc1896@mail.gmail.com">23ab5f0a0908021456x3928293al32e4e1186dfc1896@mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<br>
<br>
Hi,<br>
The attach was only the wkt definition of the polygon...<br>
Things are gettin a bit clearer now: the polygon is also valid and<br>
empty on OGR (so I guess no prob in importing it to geos).<br>
I think is outside the scope of this mailing list to tell how Im<br>
importing it into OGR, but I ll do it anyway :-)<br>
<br>
<br>
                while( (poFeature = poLayer-&gt;GetNextFeature()) != NULL )<br>
                {<br>
                        OGRGeometry *poGeometry;<br>
                        poGeometry = poFeature-&gt;GetGeometryRef();<br>
<br>
                        if( poGeometry != NULL &amp;&amp; wkbFlatten(poGeometry-&gt;getGeometryType())<br>
== wkbPolygon )<br>
                        {<br>
                                OGRPolygon *poPolygon = (OGRPolygon*) poGeometry;<br>
                                 DoStuffWithGEOS()<br>
                        }<br>
                   }<br>
Inside DoStuffWithGEOS(), I export it to text and import it (from<br>
text) to Geos. I guess this is all working fine cause it works for all<br>
the hundreds of polygons that I have, so I guess this one is &quot;special&quot;<br>
:-)<br>
I would have to look at it with a bit more detail!!<br>
It looks fine in QGis thought...<br>
<br>
<a href="http://ladybug.no-ip.org/files/emptyPolygon.png" target="_blank">http://ladybug.no-ip.org/files/emptyPolygon.png</a><br>
<br>
                                                           cheers,<br>
                                                                   Jo<br>
<br>
<br>
<br>
Jo wrote:<br>
&gt;* I just realized the mailing list truncated my last message; here it is<br>
*&gt;* (without the attach!)<br>
*<br>
Sorry, I didn&#39;t see any source code in your message.<br>
See how it is archived:<br>
<br>
<a href="http://lists.osgeo.org/pipermail/geos-devel/2009-August/004293.html" target="_blank">http://lists.osgeo.org/pipermail/geos-devel/2009-August/004293.html</a><br>
<br>
Or you mean polygon.obj attachment?<br>
<br>
<a href="http://lists.osgeo.org/pipermail/geos-devel/attachments/20090802/9e51e147/polygon.obj" target="_blank">http://lists.osgeo.org/pipermail/geos-devel/attachments/20090802/9e51e147/polygon.obj</a><br>
<br>
Best regards,<br>
<br>
<br>
<br>
2009/8/2 &lt;<a href="mailto:geos-devel-request@lists.osgeo.org">geos-devel-request@lists.osgeo.org</a>&gt;<br>
<br>
&gt; Send geos-devel mailing list submissions to<br>
&gt;        <a href="mailto:geos-devel@lists.osgeo.org">geos-devel@lists.osgeo.org</a><br>
&gt;<br>
&gt; To subscribe or unsubscribe via the World Wide Web, visit<br>
&gt;        <a href="http://lists.osgeo.org/mailman/listinfo/geos-devel" target="_blank">http://lists.osgeo.org/mailman/listinfo/geos-devel</a><br>
&gt; or, via email, send a message with subject or body &#39;help&#39; to<br>
&gt;        <a href="mailto:geos-devel-request@lists.osgeo.org">geos-devel-request@lists.osgeo.org</a><br>
&gt;<br>
&gt; You can reach the person managing the list at<br>
&gt;        <a href="mailto:geos-devel-owner@lists.osgeo.org">geos-devel-owner@lists.osgeo.org</a><br>
&gt;<br>
&gt; When replying, please edit your Subject line so it is more specific<br>
&gt; than &quot;Re: Contents of geos-devel digest...&quot;<br>
&gt;<br>
&gt;<br>
&gt; Today&#39;s Topics:<br>
&gt;<br>
&gt;   1. (not) Empty geometry (Jo)<br>
&gt;<br>
&gt;<br>
&gt; ----------------------------------------------------------------------<br>
&gt;<br>
&gt; Message: 1<br>
&gt; Date: Sun, 2 Aug 2009 21:51:41 +0100<br>
&gt; From: Jo &lt;<a href="mailto:doublebyte@gmail.com">doublebyte@gmail.com</a>&gt;<br>
&gt; Subject: [geos-devel] (not) Empty geometry<br>
&gt; To: <a href="mailto:geos-devel@lists.osgeo.org">geos-devel@lists.osgeo.org</a><br>
&gt; Message-ID:<br>
&gt;        &lt;<a href="mailto:23ab5f0a0908021351w53233efehdb82784d0c7248aa@mail.gmail.com">23ab5f0a0908021351w53233efehdb82784d0c7248aa@mail.gmail.com</a>&gt;<br>
&gt; Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<br>
&gt;<br>
&gt; Skipped content of type multipart/alternative-------------- next part<br>
&gt; --------------<br>
&gt; A non-text attachment was scrubbed...<br>
&gt; Name: polygon.wkt<br>
&gt; Type: application/octet-stream<br>
&gt; Size: 51117 bytes<br>
&gt; Desc: not available<br>
&gt; Url :<br>
&gt; <a href="http://lists.osgeo.org/pipermail/geos-devel/attachments/20090802/9e51e147/polygon.obj" target="_blank">http://lists.osgeo.org/pipermail/geos-devel/attachments/20090802/9e51e147/polygon.obj</a><br>
&gt;<br>
&gt; ------------------------------<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; geos-devel mailing list<br>
&gt; <a href="mailto:geos-devel@lists.osgeo.org">geos-devel@lists.osgeo.org</a><br>
&gt; <a href="http://lists.osgeo.org/mailman/listinfo/geos-devel" target="_blank">http://lists.osgeo.org/mailman/listinfo/geos-devel</a><br>
&gt;<br>
&gt; End of geos-devel Digest, Vol 82, Issue 3<br>
&gt; *****************************************<br>
&gt;<br>
<br>
<br>
<br>
--<br>
&quot;#define QUESTION ((bb) || !(bb))&quot;  (Shakespeare)<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://lists.osgeo.org/pipermail/geos-devel/attachments/20090802/778c5fc1/attachment-0001.html" target="_blank">http://lists.osgeo.org/pipermail/geos-devel/attachments/20090802/778c5fc1/attachment-0001.html</a><br>

<br>
------------------------------<br>
<br>
Message: 5<br>
Date: Sun, 02 Aug 2009 23:12:56 +0100<br>
From: Mateusz Loskot &lt;<a href="mailto:mateusz@loskot.net">mateusz@loskot.net</a>&gt;<br>
Subject: Re: [geos-devel] Re: (not) Empty geometry (Jo)<br>
To: GEOS Development List &lt;<a href="mailto:geos-devel@lists.osgeo.org">geos-devel@lists.osgeo.org</a>&gt;<br>
Message-ID: &lt;<a href="mailto:4A760F68.8050609@loskot.net">4A760F68.8050609@loskot.net</a>&gt;<br>
Content-Type: text/plain; charset=ISO-8859-1<br>
<br>
Jo wrote:<br>
&gt; Hi,<br>
&gt; The attach was only the wkt definition of the polygon...<br>
&gt; Things are gettin a bit clearer now: the polygon is also valid and<br>
&gt; empty on OGR (so I guess no prob in importing it to geos).<br>
&gt; I think is outside the scope of this mailing list to tell how Im<br>
&gt; importing it into OGR, but I ll do it anyway :-)<br>
&gt;<br>
&gt;<br>
&gt;               while( (poFeature = poLayer-&gt;GetNextFeature()) != NULL )<br>
&gt;               {<br>
&gt;                       OGRGeometry *poGeometry;<br>
&gt;                       poGeometry = poFeature-&gt;GetGeometryRef();<br>
&gt;<br>
&gt;                       if( poGeometry != NULL &amp;&amp; wkbFlatten(poGeometry-&gt;getGeometryType())<br>
&gt; == wkbPolygon )<br>
&gt;                       {<br>
&gt;                               OGRPolygon *poPolygon = (OGRPolygon*) poGeometry;<br>
&gt;                                  DoStuffWithGEOS()<br>
<br>
What does this return?<br>
<br>
poPolygon-&gt;getExteriorRing()-&gt;getNumPoints()<br>
<br>
&gt;                       }<br>
&gt;                    }<br>
&gt; Inside DoStuffWithGEOS(), I export it to text and import it (from<br>
&gt; text) to Geos.<br>
<br>
You don&#39;t need to go through text export/import.<br>
Just dump OGR geometry as GEOS geometry using<br>
OGRGeometry::exportToGEOS() method:<br>
<br>
<a href="http://trac.osgeo.org/gdal/browser/trunk/gdal/ogr/ogr_geometry.h#L118" target="_blank">http://trac.osgeo.org/gdal/browser/trunk/gdal/ogr/ogr_geometry.h#L118</a><br>
<br>
And check if GEOS geomtetry is OK now.<br>
<br>
Best regards,<br>
--<br>
Mateusz Loskot, <a href="http://mateusz.loskot.net" target="_blank">http://mateusz.loskot.net</a><br>
Charter Member of OSGeo, <a href="http://osgeo.org" target="_blank">http://osgeo.org</a><br>
<br>
<br>
------------------------------<br>
<br>
Message: 6<br>
Date: Mon, 03 Aug 2009 00:22:25 +0200<br>
From: Frederik Ramm &lt;<a href="mailto:frederik@remote.org">frederik@remote.org</a>&gt;<br>
Subject: [geos-devel] Polygonizer returns inner rings on their own?<br>
To: <a href="mailto:geos-devel@lists.osgeo.org">geos-devel@lists.osgeo.org</a><br>
Message-ID: &lt;<a href="mailto:4A7611A1.5080202@remote.org">4A7611A1.5080202@remote.org</a>&gt;<br>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed<br>
<br>
Hi,<br>
<br>
    why is it that the (C++) Polygonizer, when given the following four<br>
geometries,<br>
<br>
         &quot;LINESTRING(1 1, 1 10, 10 10)&quot;<br>
         &quot;LINESTRING(10 10, 10 1, 1 1)&quot;<br>
         &quot;LINESTRING(20 20, 20 30, 30 30, 30 20, 20 20)&quot;<br>
         &quot;LINESTRING(3 3, 3 4, 4 4, 4 3, 3 3)&quot;<br>
<br>
(1 and 2 together form a shell, 3 forms a disjunct shell, 4 forms an<br>
inner ring of 1+2)<br>
<br>
returns a collection of three polygons:<br>
<br>
POLYGON ((1.00 1.00, 1.00 10.00, 10.00 10.00, 10.00 1.00, 1.00 1.00),<br>
(3.00 3.00, 4.00 3.00, 4.00 4.00, 3.00 4.00, 3.00 3.00))<br>
POLYGON ((20.00 20.00, 20.00 30.00, 30.00 30.00, 30.00 20.00, 20.00 20.00))<br>
POLYGON ((3.00 3.00, 3.00 4.00, 4.00 4.00, 4.00 3.00, 3.00 3.00))<br>
<br>
I&#39;m ok with the first and second, but the third one has already been<br>
used as a &quot;hole&quot; inside the first and should not be returned again - or<br>
is there a misunderstanding on my part?<br>
<br>
Bye<br>
Frederik<br>
<br>
--<br>
Frederik Ramm  ##  eMail <a href="mailto:frederik@remote.org">frederik@remote.org</a>  ##  N49°00&#39;09&quot; E008°23&#39;33&quot;<br>
<br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
geos-devel mailing list<br>
<a href="mailto:geos-devel@lists.osgeo.org">geos-devel@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/geos-devel" target="_blank">http://lists.osgeo.org/mailman/listinfo/geos-devel</a><br>
<br>
End of geos-devel Digest, Vol 82, Issue 4<br>
*****************************************<br>
</blockquote></div><br><br clear="all"><br>-- <br>&quot;#define QUESTION ((bb) || !(bb))&quot;  (Shakespeare)<br><br>