It might better to use LocationIndexedLine for this - it uses exact vertex indices for locations, rather than computed lengths.  That makes it more precise when you are working directly with vertex indices.


On Wed, Jul 2, 2014 at 12:20 PM, André Salvati <andre.f.salvati@gmail.com> wrote:
Very simple implementation where "line" is a LineString.

Thanks Martin.

LengthIndexedLine l_i = new LengthIndexedLine(line);
Coordinate[] csSeg = l_i.extractLine(l_i.indexOf(cInicio), l_i.indexOf(cFim)).getCoordinates();



2014-07-02 14:47 GMT-03:00 Martin Davis <mtnclimb@gmail.com>:


On Tue, Jul 1, 2014 at 10:00 AM, André Salvati <andre.f.salvati@gmail.com> wrote:
Hi,

1) is there a function to extract a segment (LineString) from a bigger LineString given 2 points inside the last one?

2) I also would like to get the size of the obtained segment. Is it possible?

Thanks.

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Jts-topo-suite-user mailing list
Jts-topo-suite-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user