Re: [Jts-topo-suite-user] Segment from LineString
Brought to you by:
dr_jts
From: Martin D. <mtn...@gm...> - 2014-07-02 20:34:34
|
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 <and...@gm...> 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 <mtn...@gm...>: > >> Look into the Linear Referencing API: >> http://tsusiatsoftware.net/jts/javadoc/com/vividsolutions/jts/linearref/package-frame.html >> >> >> >> >> On Tue, Jul 1, 2014 at 10:00 AM, André Salvati <and...@gm... >> > 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...@li... >>> https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user >>> >>> >> > |