<div dir="ltr">CoordinateSequence::removeRepeatedPoints does NOT do what you want - it only removes consecutive points which have *identical* values.<div><br></div><div>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)</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 28, 2019 at 3:51 AM Paul Meems <<a href="mailto:bontepaarden@gmail.com">bontepaarden@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">I'm looking at geos::simplify::DouglasPeuckerLineSimplifier (<a href="http://geos.refractions.net/ro/doxygen_docs/html/classgeos_1_1simplify_1_1DouglasPeuckerLineSimplifier.html#_details" target="_blank">http://geos.refractions.net/ro/doxygen_docs/html/classgeos_1_1simplify_1_1DouglasPeuckerLineSimplifier.html#_details</a>) and  geos::geom::CoordinateSequence::removeRepeatedPoints (<a href="http://geos.refractions.net/ro/doxygen_docs/html/classgeos_1_1geom_1_1CoordinateSequence.html#a22" target="_blank">http://geos.refractions.net/ro/doxygen_docs/html/classgeos_1_1geom_1_1CoordinateSequence.html#a22</a>)</div><div dir="ltr"><div dir="ltr" class="gmail-m_-3612958454137313968gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><br></div><div>Looking at the explanation of the Ramer–Douglas–Peucker algorithm (<a href="https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm" target="_blank">https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm</a>) I understand that the resulting geometry might be slightly different, that's why a tolerance needs to be added.</div><div><br></div><div>But I don't want my geometry to be altered I just want to remove vertices that don't contribute to the shape of the geometry. </div><div>Consider a square with not only 4 corner points but also points between the corner points.</div><div>Those points I want to remove because they are redundant and without them, I still have the 'same' square.</div><div><br></div><div>Should/can I use removeRepeatedPoints() or should I use another method?</div><div dir="ltr"><br></div><div dir="ltr">Thanks,<br>
<br>Paul<br><br>
</div></div></div></div></div></div></div></div></div></div>
_______________________________________________<br>
geos-devel mailing list<br>
<a href="mailto:geos-devel@lists.osgeo.org" target="_blank">geos-devel@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/geos-devel" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/geos-devel</a></blockquote></div>