if (bbox == null || !bbox.isSane()) { throw new ServiceException("The bounding box parameter (" + values.get("srs") + ") is missing or not sane");
if (bbox == null || !bbox.isSane()) { throw new ServiceException( "The bounding box parameter ("
/** * Verifies that this functions output remains as expected, since we communicate a lot using * strings. * * <p>Ff not you should figure out where it is used. * * @throws Exception */ public void testBBOX() throws Exception { BoundingBox bbox = new BoundingBox(-180.0, -90.0, 180.0, 90.0); assert (bbox.isSane()); String bboxStr = bbox.toString(); if (bboxStr.equalsIgnoreCase("-180.0,-90.0,180.0,90.0")) { assertTrue(true); } else { assertTrue(false); } }
try { bbox = new BoundingBox(requestBbox); if (bbox == null || !bbox.isSane()) { throw new ServiceException("The bounding box parameter (" + requestBbox + ") is missing or not sane");
try { bbox = new BoundingBox(requestBbox); if (bbox == null || !bbox.isSane()) { throw new ServiceException( "The bounding box parameter ("
public void testBBOXScale() throws Exception { BoundingBox bbox = new BoundingBox(-180.0, -90.0, 180.0, 90.0); BoundingBox copy = new BoundingBox(bbox); bbox.scale(1.0); bbox.scale(0.5); bbox.scale(2.0); assert (bbox.isSane()); assert (bbox.equals(copy)); }
Assert.notNull(srs, "srs is null"); Assert.notNull(extent, "extent is null"); Assert.isTrue(!extent.isNull() && extent.isSane(), "Extent is invalid: " + extent); Assert.isTrue(resolutions != null || scaleDenoms != null); Assert.isTrue(
public void testIntersection() throws Exception { BoundingBox bb1 = new BoundingBox(0, 0, 10, 10); BoundingBox bb2 = new BoundingBox(5, 5, 20, 20); BoundingBox intersection = BoundingBox.intersection(bb1, bb2); assertNotNull(intersection); assertEquals(5D, intersection.getWidth()); assertEquals(5D, intersection.getHeight()); assertTrue(intersection.isSane()); assertTrue(Arrays.equals(new double[] {5, 5, 10, 10}, intersection.getCoords())); }
/** * Two bboxes don't intersect, BoundingBox.intersection()'s result should be the empty bbox * * @throws Exception */ public void testIntersectionNonIntersecting() throws Exception { BoundingBox bb1 = new BoundingBox(0, 0, 10, 10); BoundingBox bb2 = new BoundingBox(11, 11, 20, 20); BoundingBox intersection = BoundingBox.intersection(bb1, bb2); assertNotNull(intersection); assertTrue(intersection.isNull()); assertFalse(intersection.isSane()); } }