<div dir="ltr">Actually in JTS this is possible, by creating a CoordinateSequence implementation which allows extending the list of coordinates (e.g. something like this [1]).<div><br></div><div>I guess the difference is that in C/C++ the API has to explicitly control the lifetime of the geometry associated structures.  Whereas in Java object lifetimes are managed by the GC, and objects can live as long as they are being referenced.</div><div><br></div><div>Not sure what the best way to ease this constraint is - but it seems like there should be a common pattern to make this work?</div><div><br></div><div>[1] <a href="https://github.com/locationtech/jts/pull/271">https://github.com/locationtech/jts/pull/271</a></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 24, 2018 at 5:58 AM, Sandro Santilli <span dir="ltr"><<a href="mailto:strk@kbt.io" target="_blank">strk@kbt.io</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Thu, May 24, 2018 at 09:36:57AM +0200, Tanguy Fardet wrote:<br>
> Dear GEOS developers,<br>
> <br>
> I would like to know if there is a way, within the GEOS library, to either<br>
> 1) modify an existing LineString without copying the existing points inside<br>
> or 2) create a LineString from a CoordinateSequence without having to clone<br>
> the latter and without it being destroyed with the LineString (i.e. how to<br>
> not transfer ownership).<br>
> <br>
> From a quick look at the code, this does not seem possible, but I would like<br>
> to make sure it is indeed the case.<br>
<br>
</span>I confirm this is the case, by (JTS-following) design.<br>
<br>
--strk;<br>
<div class="HOEnZb"><div class="h5">______________________________<wbr>_________________<br>
geos-devel mailing list<br>
<a href="mailto:geos-devel@lists.osgeo.org">geos-devel@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/geos-devel" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/geos-devel</a></div></div></blockquote></div><br></div>