You should be able to use a DouglasPeuckerSimplifier to achieve this.
Something like:

    DouglasPeuckerSimplifier simplifier = new DouglasPeuckerSimplifier(in);
    simplifier.setDistanceTolerance(tolerance);
    Geometry out =  simplifier.getResultGeometry();

would do it.

JTS also provides a TopologyPresersevingSimplifier and a
LineSegmentSimplifier that would also handle your case.

Ian

On Fri, 15 Mar 2019 at 06:32, <paul.m...@lfv.se> wrote:

> Hi,
>
> I wonder if there is a generalize function using angles.
>
> I have polygons almost like a rectangle/romb. 90 percent has only five
> vertices, but some have more. The extra vertices is om the sides (the
> straight lines).
>
> I would like to remove those vertices and thought that there perhaps is a
> method using a max angle to find the extra vertices.
>
> Kind regards,
>
> Paul
> _______________________________________________
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to