Hi,<br>I'm fighting with some memory leaks at the moment, and I was wondering what's the best way to release an object created with GeometryFactory; for instance:<br><br>geos::geom::GeometryFactory::createPoint(geos::geom::Coordinate const&) <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"><<a href="mailto:geos-devel-request@lists.osgeo.org">geos-devel-request@lists.osgeo.org</a>></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 'help' 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 "Re: Contents of geos-devel digest..."<br>
<br>
<br>
Today'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 <<a href="mailto:strk@keybit.net">strk@keybit.net</a>><br>
Subject: Re: [geos-devel] Porting LengthIndexedLine.project?<br>
To: David Turner <<a href="mailto:novalis@novalis.org">novalis@novalis.org</a>>, Martin Davis<br>
<<a href="mailto:mbdavis@refractions.net">mbdavis@refractions.net</a>>, GEOS Development List<br>
<<a href="mailto:geos-devel@lists.osgeo.org">geos-devel@lists.osgeo.org</a>><br>
Message-ID: <<a href="mailto:20090804185158.GA30859@keybit.net">20090804185158.GA30859@keybit.net</a>><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 & 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>
> Let's ask Martin...<br>
> Are unit tests for LengthIndexedLine available or to be made ?<br>
><br>
> --strk;<br>
><br>
> On Sat, Aug 01, 2009 at 12:02:07AM -0400, David Turner wrote:<br>
> > On Mon, 2009-07-27 at 17:42 -0400, David Turner wrote:<br>
> > > On Thu, 2009-07-23 at 21:53 +0200, strk wrote:<br>
> > > > On Thu, Jul 23, 2009 at 11:13:34AM -0400, David Turner wrote:<br>
> > > > > JTS has a class called LengthIndexedLine with a method "project", which<br>
> > > > > lets you figure out the nearest point on a line to a given point. This<br>
> > > > > is useful, for instance, if you are trying to figure out what street a<br>
> > > > > person is on from (possibly slightly inaccurate) GPS observations.<br>
> > > > ><br>
> > > > > <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>
> > > > ><br>
> > > > > PostGIS calls this function st_line_locate_point.<br>
> > > > ><br>
> > > > > GEOS doesn't seem to have it, even though I was under the impression<br>
> > > > > that GEOS was merely a port of JTS. If I port JTS's project function<br>
> > > > > and related functions such as extractPoint to GEOS, would that patch be<br>
> > > > > likely to be accepted? Or am I missing something about the relationship<br>
> > > > > between JTS and GEOS?<br>
> > > ><br>
> > > > Your patch would be welcome. Make sure to include unit testing please.<br>
> > ><br>
> > > I have a patch. Unfortunately, I do not yet have unit tests, because I<br>
> > > cannot find the relevant Java unit tests to port. I could write my own,<br>
> > > but it seems like some of the other code uses ported Java unit tests,<br>
> > > and I want to follow the common practice.<br>
> > ><br>
> > > Can you point me to the Java unit tests?<br>
> ><br>
> > Just wanted to follow up to be sure this wasn't lost. The example I'm<br>
> > looking at, in case I'm missing something, is:<br>
> ><br>
> > tests/unit/algorithm/RobustLineIntersectionTest.cpp<br>
> ><br>
> > which claims to be:<br>
> ><br>
> > Ported from JTS junit/algorithm/RobustLineIntersectionTest.java<br>
> ><br>
> > I assume there are probably similar tests for the linearref stuff, but<br>
> > the JTS CVS appears to be empty or down or something, and Googling turns<br>
> > up nothing.<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>
> --<br>
><br>
> Free GIS & 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>
> 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>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Wed, 05 Aug 2009 09:01:07 -0700<br>
From: Martin Davis <<a href="mailto:mbdavis@refractions.net">mbdavis@refractions.net</a>><br>
Subject: Re: [geos-devel] Polygonizer returns inner rings on their<br>
own?<br>
To: GEOS Development List <<a href="mailto:geos-devel@lists.osgeo.org">geos-devel@lists.osgeo.org</a>><br>
Message-ID: <<a href="mailto:4A79ACC3.4050703@refractions.net">4A79ACC3.4050703@refractions.net</a>><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'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>
> Hi,<br>
><br>
> why is it that the (C++) Polygonizer, when given the following four<br>
> geometries,<br>
><br>
> "LINESTRING(1 1, 1 10, 10 10)"<br>
> "LINESTRING(10 10, 10 1, 1 1)"<br>
> "LINESTRING(20 20, 20 30, 30 30, 30 20, 20 20)"<br>
> "LINESTRING(3 3, 3 4, 4 4, 4 3, 3 3)"<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<br>
> 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'm ok with the first and second, but the third one has already been<br>
> used as a "hole" inside the first and should not be returned again -<br>
> or is there a misunderstanding on my part?<br>
><br>
> Bye<br>
> Frederik<br>
><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>"#define QUESTION ((bb) || !(bb))" (Shakespeare)<br><br>