@Test public void expand() { ReferencedEnvelope env = new ReferencedEnvelope(2.6, 9.4, 2.4, 9.6, null); ReferencedEnvelope result = Envelopes.expandToInclude(env, 1.0); ReferencedEnvelope expected = new ReferencedEnvelope(2.0, 10.0, 2.0, 10.0, null); assertTrue(expected.boundsEquals2D(result, TOL)); }
public static ReferencedEnvelope expandToInclude(ReferencedEnvelope srcEnv, double resolution) { double minX = roundOrdinate(srcEnv.getMinX(), resolution, false); double maxX = roundOrdinate(srcEnv.getMaxX(), resolution, true); double minY = roundOrdinate(srcEnv.getMinY(), resolution, false); double maxY = roundOrdinate(srcEnv.getMaxY(), resolution, true); ReferencedEnvelope expanded = new ReferencedEnvelope(srcEnv); expanded.expandToInclude(minX, minY); expanded.expandToInclude(maxX, maxY); return expanded; }
Envelopes { public static ReferencedEnvelope expandToInclude(ReferencedEnvelope srcEnv, double resolution) { double minX = roundOrdinate(srcEnv.getMinX(), resolution, false); double maxX = roundOrdinate(srcEnv.getMaxX(), resolution, true); double minY = roundOrdinate(srcEnv.getMinY(), resolution, false); double maxY = roundOrdinate(srcEnv.getMaxY(), resolution, true); ReferencedEnvelope expanded = new ReferencedEnvelope(srcEnv); expanded.expandToInclude(minX, minY); expanded.expandToInclude(maxX, maxY); return expanded; } }
Envelopes { public static ReferencedEnvelope expandToInclude(ReferencedEnvelope srcEnv, double resolution) { double minX = roundOrdinate(srcEnv.getMinX(), resolution, false); double maxX = roundOrdinate(srcEnv.getMaxX(), resolution, true); double minY = roundOrdinate(srcEnv.getMinY(), resolution, false); double maxY = roundOrdinate(srcEnv.getMaxY(), resolution, true); ReferencedEnvelope expanded = new ReferencedEnvelope(srcEnv); expanded.expandToInclude(minX, minY); expanded.expandToInclude(maxX, maxY); return expanded; }  }
Envelopes { public static ReferencedEnvelope expandToInclude(ReferencedEnvelope srcEnv, double resolution) { double minX = roundOrdinate(srcEnv.getMinX(), resolution, false); double maxX = roundOrdinate(srcEnv.getMaxX(), resolution, true); double minY = roundOrdinate(srcEnv.getMinY(), resolution, false); double maxY = roundOrdinate(srcEnv.getMaxY(), resolution, true); ReferencedEnvelope expanded = new ReferencedEnvelope(srcEnv); expanded.expandToInclude(minX, minY); expanded.expandToInclude(maxX, maxY); return expanded; }  static ReferencedEnvelope expandToInclude(ReferencedEnvelope srcEnv, double resolution); }
Envelopes { public static ReferencedEnvelope expandToInclude(ReferencedEnvelope srcEnv, double resolution) { double minX = roundOrdinate(srcEnv.getMinX(), resolution, false); double maxX = roundOrdinate(srcEnv.getMaxX(), resolution, true); double minY = roundOrdinate(srcEnv.getMinY(), resolution, false); double maxY = roundOrdinate(srcEnv.getMaxY(), resolution, true); ReferencedEnvelope expanded = new ReferencedEnvelope(srcEnv); expanded.expandToInclude(minX, minY); expanded.expandToInclude(maxX, maxY); return expanded; }  static ReferencedEnvelope expandToInclude(ReferencedEnvelope srcEnv, double resolution);  }