public Geometry simplifyGeometryAtResolution ( Geometry geometry , double resolution ) throws Exception { double inverseRes = 1 / resolution ; double p = Math . log10 ( inverseRes ) ; double exp = Math . ceil ( p ) ; if ( exp < 0 ) exp = 0 ; double factor = Math . pow ( 10 , exp ) ; Geometry simplifiedGeometry = simplify ( geometry , resolution , factor ) ; return simplifiedGeometry ; }
Accepts a geometry and a resolution . Returns a version of the geometry which is simplified for the given resolution . If the initial geometry is already simplified enough then return null .