Hi Martin
I was using the class directly (not using the DiscreteHausdorffDistance) I'm using it to calculate the distance of a point towards a Geometry, but I'm not only interesting in the distance-value, but also on the location of that distance. At the end it is used to generalize merged linestrings: E.g. typical I have motorways with several "parallel" linestrings but want to generalize them into one single linestring.
On 11.01.2013, at 18:52, Martin Davis <mtnclimb@...> wrote:
> Fixed in SVN.
>
> Out of interest, did this problem show up when you were using the
> DiscreteHausdorffDistance class? If so, what's the use case?
>
>
> On 1/11/2013 5:10 AM, Michael Kussmaul wrote:
>> Hi
>>
>> I'm also using JTS in a multi-threaded environment. While I don't share geometries between threads I sometimes experience data-corruption issues (broken geometries). After some searching I found a small issue in the DistanceToPoint class and modified it a bit (in fact the changes are almost trivial) perhaps you could add them into the jts-trunk?
>>
>> kind regards
>> Michael
>>
>> - I removed the static LineSegment
>> - I added the temporary lineSegement directly in to method who uses it
>>
>> Index: DistanceToPoint.java
>> ===================================================================
>> --- DistanceToPoint.java (revision 724)
>> +++ DistanceToPoint.java (working copy)
>> @@ -40,9 +40,6 @@
>> */
>> public class DistanceToPoint {
>>
>> - // used for point-line distance calculation
>> - private static LineSegment tempSegment = new LineSegment();
>> -
>> public DistanceToPoint() {
>> }
>>
>> @@ -68,6 +65,7 @@
>> public static void computeDistance(LineString line, Coordinate pt, PointPairDistance ptDist)
>> {
>> Coordinate[] coords = line.getCoordinates();
>> + LineSegment tempSegment = new LineSegment();
>> for (int i = 0; i < coords.length - 1; i++) {
>> tempSegment.setCoordinates(coords[i], coords[i + 1]);
>> // this is somewhat inefficient - could do better
>> ------------------------------------------------------------------------------
>> Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
>> much more. Get web development skills now with LearnDevNow -
>> 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
>> SALE $99.99 this month only -- learn more at:
>> http://p.sf.net/sfu/learnmore_122812
>> _______________________________________________
>> Jts-topo-suite-user mailing list
>> Jts-topo-suite-user@...
>> https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user
>>
>>
>> -----
>> No virus found in this message.
>> Checked by AVG - http://www.avg.com
>> Version: 2013.0.2805 / Virus Database: 2637/6000 - Release Date: 12/31/12
>> Internal Virus Database is out of date.
>>
>>
>
>
> ------------------------------------------------------------------------------
> Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
> much more. Get web development skills now with LearnDevNow -
> 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
> SALE $99.99 this month only -- learn more at:
> http://p.sf.net/sfu/learnmore_122812
> _______________________________________________
> Jts-topo-suite-user mailing list
> Jts-topo-suite-user@...
> https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user
|