protected List < Point > simplifyPoints ( double simplifyTolerance , List < Point > points ) { List < Point > simplifiedPoints = null ; if ( simplifyGeometries ) { // Reproject to web mercator if not in meters if ( projection != null && ! projection . isUnit ( Units . METRES ) ) { ProjectionTransform toWebMercator = projection . getTransformation ( WEB_MERCATOR_PROJECTION ) ; points = toWebMercator . transform ( points ) ; } // Simplify the points simplifiedPoints = GeometryUtils . simplifyPoints ( points , simplifyTolerance ) ; // Reproject back to the original projection if ( projection != null && ! projection . isUnit ( Units . METRES ) ) { ProjectionTransform fromWebMercator = WEB_MERCATOR_PROJECTION . getTransformation ( projection ) ; simplifiedPoints = fromWebMercator . transform ( simplifiedPoints ) ; } } else { simplifiedPoints = points ; } return simplifiedPoints ; }
When the simplify tolerance is set simplify the points to a similar curve with fewer points .