|
Geometry : |
Subject: Re: [geometry] Douglas Peucker on 3D lines
From: Barend Gehrels (barend_at_[hidden])
Date: 2012-06-20 05:58:39
Hi Stephan,
On 20-6-2012 10:02, Stephan Menzel wrote:
> I am currently using 1.49 geometry and I am generally impressed at the
> neat design and ease of use.
Thanks.
> Now the first question is, the way I understand the docs, I shouldn't
> have to specify a Strategy. But with the default strategy I get a
> static assertion error telling me this is not supported for my point
> type. Why?
I will find this out later. Indeed this is unexpected so I think it is a
too strict assertion somewhere.
>
> Second question:
> I have tried several PointSegmentDistanceStartegies, this was the only
> one that compiled. The others threw plenty of errors at me as soon as
> I got their headers included (MSVC2008). Are they different in what
> they do or only in complexity and cost? In other words: Can I just use
> that one that did compile or is in in some way worse than the others?
This is the correct one indeed. Which more are there (for Cartesian?) I
think for Cartesian there is only one included? For Spherical there are
two (indeed redundant, have to be cleaned).
> Third, and most important: What exactly does the max_distance
> parameter mean? I was under the impression that this is the maximum
> distance a point can be apart from another to be considerered for
> deletion. Which would mean, as I understand it, that if I say 1.0
> here, I will get points not further apart than 1millimeter (which
> would be my unit here). Tests however show that I get a smooth line
> with most segments roughly 1meter(!) length. Which makes the curve
> appear quite rough at hills and sharp turns. So am I interpreting this
> wrong? Can you help me understand this?
We have to explain that in the docs. It is the max distance, measured
orthogonal to the linestring , for a segment to be included.
I need a drawing to explain it well.
So on this page:
http://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm
in the figure on the right, marked with "1". You see an "a", "b", "c"
there. If "b" > max.distance it will be included. If "b" < max.distance,
it will not be included in the resulting linestring.
> Last I would like to comment that the docs are wrong about simplify().
> They state that the strategy parameter is first, while if fact it is
> the last. So maybe that could be corrected.
Weird - it must be generated like this. Will fix that. Thanks.
Regards, Barend
Geometry list run by mateusz at loskot.net