private void layerWGS84BoundingBox(XMLBuilder xml, TileLayer layer) throws IOException { GridSubset subset = layer.getGridSubsetForSRS(SRS.getEPSG4326()); if (subset != null) { double[] coords = subset.getOriginalExtent().getCoords(); xml.indentElement("ows:WGS84BoundingBox"); xml.simpleElement("ows:LowerCorner", coords[0] + " " + coords[1], true); double[] coords = subset.getOriginalExtent().getCoords(); double originShift = 2 * Math.PI * 6378137 / 2.0; double mx = coords[0];
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())); }
double[] coords = gridSub.getCoverageBestFitBounds().getCoords(); xml.boundingBox(null, coords[0], coords[1], coords[2], coords[3]); xml.indentElement("Origin")