Hi,<br>I&#39;m fighting with some memory leaks at the moment, and I was wondering what&#39;s the best way to release an object created with GeometryFactory; for instance:<br><br>geos::geom::GeometryFactory::createPoint(geos::geom::Coordinate const&amp;) <br>
<br>Is it GeometryFactory::DestroyGeometry ?<br>Sorry, but I did not see any reference on how to do this on the documentation or examples; if I missed it, it would be great if you could point me there...<br>                          Thanks in advance,<br>
                                                    regards,<br>                                                                Jo<br><br><div class="gmail_quote">2009/8/5  <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: Porting LengthIndexedLine.project? (strk)<br>
   2. Re: Polygonizer returns inner rings on their own? (Martin Davis)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Tue, 4 Aug 2009 20:51:58 +0200<br>
From: strk &lt;<a href="mailto:strk@keybit.net">strk@keybit.net</a>&gt;<br>
Subject: Re: [geos-devel] Porting LengthIndexedLine.project?<br>
To: David Turner &lt;<a href="mailto:novalis@novalis.org">novalis@novalis.org</a>&gt;, Martin Davis<br>
        &lt;<a href="mailto:mbdavis@refractions.net">mbdavis@refractions.net</a>&gt;,      GEOS Development List<br>
        &lt;<a href="mailto:geos-devel@lists.osgeo.org">geos-devel@lists.osgeo.org</a>&gt;<br>
Message-ID: &lt;<a href="mailto:20090804185158.GA30859@keybit.net">20090804185158.GA30859@keybit.net</a>&gt;<br>
Content-Type: text/plain; charset=us-ascii<br>
<br>
Martin forgot to answer publically, anyway, he mentioned<br>
tests are here: test.jts.junit.linearref<br>
<br>
NOTE: they are only in CVS:<br>
<br>
 :pserver:cvs@cvs.jump-project.org:/home/cvs/jts<br>
<br>
--strk;<br>
<br>
 Free GIS &amp; Flash consultant/developer      ()  ASCII Ribbon Campaign<br>
 <a href="http://foo.keybit.net/%7Estrk/services.html" target="_blank">http://foo.keybit.net/~strk/services.html</a>  /\  Keep it simple!<br>
<br>
On Sun, Aug 02, 2009 at 03:23:18PM +0200, strk wrote:<br>
&gt; Let&#39;s ask Martin...<br>
&gt; Are unit tests for LengthIndexedLine available or to be made ?<br>
&gt;<br>
&gt; --strk;<br>
&gt;<br>
&gt; On Sat, Aug 01, 2009 at 12:02:07AM -0400, David Turner wrote:<br>
&gt; &gt; On Mon, 2009-07-27 at 17:42 -0400, David Turner wrote:<br>
&gt; &gt; &gt; On Thu, 2009-07-23 at 21:53 +0200, strk wrote:<br>
&gt; &gt; &gt; &gt; On Thu, Jul 23, 2009 at 11:13:34AM -0400, David Turner wrote:<br>
&gt; &gt; &gt; &gt; &gt; JTS has a class called LengthIndexedLine with a method &quot;project&quot;, which<br>
&gt; &gt; &gt; &gt; &gt; lets you figure out  the nearest point on a line to a given point.  This<br>
&gt; &gt; &gt; &gt; &gt; is useful, for instance, if you are trying to figure out what street a<br>
&gt; &gt; &gt; &gt; &gt; person is on from (possibly slightly inaccurate) GPS observations.<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; <a href="http://tsusiatsoftware.net/jts/javadoc/com/vividsolutions/jts/linearref/LengthIndexedLine.html#project%28com.vividsolutions.jts.geom.Coordinate%29" target="_blank">http://tsusiatsoftware.net/jts/javadoc/com/vividsolutions/jts/linearref/LengthIndexedLine.html#project(com.vividsolutions.jts.geom.Coordinate)</a><br>

&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; PostGIS calls this function st_line_locate_point.<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; GEOS doesn&#39;t seem to have it, even though I was under the impression<br>
&gt; &gt; &gt; &gt; &gt; that GEOS was merely a port of JTS.  If I port JTS&#39;s project function<br>
&gt; &gt; &gt; &gt; &gt; and related functions such as extractPoint to GEOS, would that patch be<br>
&gt; &gt; &gt; &gt; &gt; likely to be accepted?  Or am I missing something about the relationship<br>
&gt; &gt; &gt; &gt; &gt; between JTS and GEOS?<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Your patch would be welcome. Make sure to include unit testing please.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I have a patch.  Unfortunately, I do not yet have unit tests, because I<br>
&gt; &gt; &gt; cannot find the relevant Java unit tests to port.  I could write my own,<br>
&gt; &gt; &gt; but it seems like some of the other code uses ported Java unit tests,<br>
&gt; &gt; &gt; and I want to follow the common practice.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Can you point me to the Java unit tests?<br>
&gt; &gt;<br>
&gt; &gt; Just wanted to follow up to be sure this wasn&#39;t lost.  The example I&#39;m<br>
&gt; &gt; looking at, in case I&#39;m missing something, is:<br>
&gt; &gt;<br>
&gt; &gt; tests/unit/algorithm/RobustLineIntersectionTest.cpp<br>
&gt; &gt;<br>
&gt; &gt; which claims to be:<br>
&gt; &gt;<br>
&gt; &gt; Ported from JTS junit/algorithm/RobustLineIntersectionTest.java<br>
&gt; &gt;<br>
&gt; &gt; I assume there are probably similar tests for the linearref stuff, but<br>
&gt; &gt; the JTS CVS appears to be empty or down or something, and Googling turns<br>
&gt; &gt; up nothing.<br>
&gt; &gt;<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; geos-devel mailing list<br>
&gt; &gt; <a href="mailto:geos-devel@lists.osgeo.org">geos-devel@lists.osgeo.org</a><br>
&gt; &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; --<br>
&gt;<br>
&gt;  Free GIS &amp; Flash consultant/developer      ()  ASCII Ribbon Campaign<br>
&gt;  <a href="http://foo.keybit.net/%7Estrk/services.html" target="_blank">http://foo.keybit.net/~strk/services.html</a>  /\  Keep it simple!<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>
<br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Wed, 05 Aug 2009 09:01:07 -0700<br>
From: Martin Davis &lt;<a href="mailto:mbdavis@refractions.net">mbdavis@refractions.net</a>&gt;<br>
Subject: Re: [geos-devel] Polygonizer returns inner rings on their<br>
        own?<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:4A79ACC3.4050703@refractions.net">4A79ACC3.4050703@refractions.net</a>&gt;<br>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed<br>
<br>
The Polygonizer creates every possible polygon defined by the input<br>
linework.  That is, it forms the linework into a polygonal coverage.<br>
That&#39;s why the hole also has a polygon filling it.<br>
<br>
This is one common requirement for polygonization.  Howwever, I can see<br>
that it might be useful to be able to specify that the Polygonizer<br>
should return only a (Multi)Polygon out of the input linework, which<br>
sounds like it would meet your need.  This would compute the depth<br>
parity of the (potentially nested) polygons, and discard those with even<br>
parity.  I might try and add this to JTS shortly.<br>
<br>
Frederik Ramm wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt;    why is it that the (C++) Polygonizer, when given the following four<br>
&gt; geometries,<br>
&gt;<br>
&gt;         &quot;LINESTRING(1 1, 1 10, 10 10)&quot;<br>
&gt;         &quot;LINESTRING(10 10, 10 1, 1 1)&quot;<br>
&gt;         &quot;LINESTRING(20 20, 20 30, 30 30, 30 20, 20 20)&quot;<br>
&gt;         &quot;LINESTRING(3 3, 3 4, 4 4, 4 3, 3 3)&quot;<br>
&gt;<br>
&gt; (1 and 2 together form a shell, 3 forms a disjunct shell, 4 forms an<br>
&gt; inner ring of 1+2)<br>
&gt;<br>
&gt; returns a collection of three polygons:<br>
&gt;<br>
&gt; POLYGON ((1.00 1.00, 1.00 10.00, 10.00 10.00, 10.00 1.00, 1.00 1.00),<br>
&gt; (3.00 3.00, 4.00 3.00, 4.00 4.00, 3.00 4.00, 3.00 3.00))<br>
&gt; POLYGON ((20.00 20.00, 20.00 30.00, 30.00 30.00, 30.00 20.00, 20.00<br>
&gt; 20.00))<br>
&gt; POLYGON ((3.00 3.00, 3.00 4.00, 4.00 4.00, 4.00 3.00, 3.00 3.00))<br>
&gt;<br>
&gt; I&#39;m ok with the first and second, but the third one has already been<br>
&gt; used as a &quot;hole&quot; inside the first and should not be returned again -<br>
&gt; or is there a misunderstanding on my part?<br>
&gt;<br>
&gt; Bye<br>
&gt; Frederik<br>
&gt;<br>
<br>
--<br>
Martin Davis<br>
Senior Technical Architect<br>
Refractions Research, Inc.<br>
(250) 383-3022<br>
<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 7<br>
*****************************************<br>
</blockquote></div><br><br clear="all"><br>-- <br>&quot;#define QUESTION ((bb) || !(bb))&quot;  (Shakespeare)<br><br>