Hi Martin,

I found a small problem in linear referencing package (JTS 1.13).

If I extract a point at distance 100 on LINESTRING(0 0, 100 0)
- I get 100, 0 with extractPoint(100) : test in testbuilder
- I get 0, 0 with extractPoint(100, 0) : test through OpenJUMP

The result is not the same with the single parameter method
and the two parameters method.

I think the problem comes from LengthLocationMap#getLocationForward
It computes the following LinearLocation (which seems OK so far)
getSegmentIndex = 1 (virtual second segment)
getSegmentFraction = 0.0 (first point)

but in this particular case, LinearLocation#getSegment() returns
segment n-1 and not segment n (probably needed to be able to compute
offset).
To be consistent , returned LinearLocation should probably have
segmentIndex = 0
segmentFraction = 1.0

Not sure if the problem is in LengthLocationMap#getLocationForward itself
or in LinearIterator#isEndOfLine() which is used by the former and returns
false if (componentIndex >= numLines)
or maybe I missed the point,

thanks for your help

Michaël


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
_______________________________________________
Jts-topo-suite-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user

Reply via email to