[geos-devel] Simplify vs removeRepeatedPoints

Martin Davis mtnclimb at gmail.com
Thu Mar 28 09:09:35 PDT 2019


On Thu, Mar 28, 2019 at 8:49 AM Sandro Santilli <strk at kbt.io> wrote:

> On Thu, Mar 28, 2019 at 07:59:05AM -0700, Martin Davis wrote:
> > CoordinateSequence::removeRepeatedPoints does NOT do what you want - it
> > only removes consecutive points which have *identical* values.
> >
> > You can probably use the DP Simplifier to remove redundant point along
> > straight lines by calling it with a very small distance tolerance.  This
> > will be a bit brittle however - if there happen to be points along the
> > square edges which are within that tolerance of a corner then the corner
> > point might get removed instead.  (For non-rectilinear geometry this
> > doesn't really matter, but of course for a rectangle it will make it
> > slightly non-rectilinear)
>
> That possibility only exists with a tolerance != 0, doesn't it ?
>

Yes.  Your suggestion of using tolerance = 0 is defnitely the better way to
handle this.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geos-devel/attachments/20190328/6e1f81f5/attachment-0001.html>


More information about the geos-devel mailing list