public ReferencedEnvelope getNativeBoundingBox() { return delegate.getNativeBoundingBox(); }
if (cinfo.getLatLonBoundingBox() == null && cinfo.getNativeBoundingBox() == null) { GeneralEnvelope envelope = reader.getOriginalEnvelope(); } else if (cinfo.getLatLonBoundingBox() == null) { setupBounds(cinfo); } else if (cinfo.getNativeBoundingBox() == null && cinfo.getNativeCRS() != null) { ReferencedEnvelope boundsLatLon = cinfo.getLatLonBoundingBox(); cinfo.setNativeBoundingBox(boundsLatLon.transform(cinfo.getNativeCRS(), true));
@Test public void testNativeBoundsDefensiveCopy() throws Exception { Catalog cat = getCatalog(); CatalogBuilder cb = new CatalogBuilder(cat); cb.setStore(cat.getCoverageStoreByName(MockData.TASMANIA_DEM.getLocalPart())); CoverageInfo ci = cb.buildCoverage(); // setup the reproject to declared policy, the issue happens only under this condition ReferencedEnvelope nativeBounds = ci.getNativeBoundingBox(); for (ProjectionPolicy pp : ProjectionPolicy.values()) { ci.setProjectionPolicy(pp); ReferencedEnvelope bbox = ci.boundingBox(); assertNotSame(nativeBounds, bbox); } }
srs, real.getProjectionPolicy(), real.getNativeBoundingBox(), real.getLatLonBoundingBox());
@Test public void testMultiBandCoverage() throws Exception { Catalog cat = getCatalog(); CatalogBuilder cb = new CatalogBuilder(cat); cb.setStore(cat.getCoverageStoreByName(MockData.TASMANIA_BM.getLocalPart())); CoverageInfo ci = cb.buildCoverage(); // perform basic checks assertEquals(CRS.decode("EPSG:4326", true), ci.getCRS()); assertEquals("EPSG:4326", ci.getSRS()); assertNotNull(ci.getNativeCRS()); assertNotNull(ci.getNativeBoundingBox()); assertNotNull(ci.getLatLonBoundingBox()); // check the coverage dimensions List<CoverageDimensionInfo> dimensions = ci.getDimensions(); assertEquals(3, dimensions.size()); CoverageDimensionInfo dimension = dimensions.get(0); assertEquals("RED_BAND", dimension.getName()); assertEquals(0, dimension.getNullValues().size()); assertEquals(Double.NEGATIVE_INFINITY, dimension.getRange().getMinimum(), 0d); assertEquals(Double.POSITIVE_INFINITY, dimension.getRange().getMaximum(), 0d); assertEquals("W.m-2.Sr-1", dimension.getUnit()); }
@Test public void testSingleBandedCoverage() throws Exception { // build a feature type (it's already in the catalog, but we just want to // check it's built as expected // LINES is a feature type with a native SRS, so we want the bounds to be there Catalog cat = getCatalog(); CatalogBuilder cb = new CatalogBuilder(cat); cb.setStore(cat.getCoverageStoreByName(MockData.TASMANIA_DEM.getLocalPart())); CoverageInfo ci = cb.buildCoverage(); // perform basic checks assertEquals(CRS.decode("EPSG:4326", true), ci.getCRS()); assertEquals("EPSG:4326", ci.getSRS()); assertNotNull(ci.getNativeCRS()); assertNotNull(ci.getNativeBoundingBox()); assertNotNull(ci.getLatLonBoundingBox()); // check the coverage dimensions List<CoverageDimensionInfo> dimensions = ci.getDimensions(); assertEquals(1, dimensions.size()); CoverageDimensionInfo dimension = dimensions.get(0); assertEquals("GRAY_INDEX", dimension.getName()); assertEquals(1, dimension.getNullValues().size()); assertEquals(-9999, dimension.getNullValues().get(0), 0d); assertEquals(Double.NEGATIVE_INFINITY, dimension.getRange().getMinimum(), 0d); // Huston, we have a problem here... // assertEquals(9999, dimension.getRange().getMaximum(), 0d); assertNull(dimension.getUnit()); }
@Override protected void onSubmit(AjaxRequestTarget target) { details.setVisible(true); String coverageName = coverage.getModelObject(); Catalog catalog = GeoServerApplication.get().getCatalog(); CoverageInfo ci = catalog.getCoverageByName(coverageName); ReferencedEnvelope ri = ci.getNativeBoundingBox(); final GetCoverageRequest gc = WCSRequestBuilderPanel.this.getCoverage; gc.bounds = ri; gc.targetCRS = ri.getCoordinateReferenceSystem(); gc.sourceGridRange = null; describeLink.setEnabled(true); target.add(WCSRequestBuilderPanel.this); } });
@Override protected void onSubmit(AjaxRequestTarget target) { details.setVisible(true); String coverageName = coverage.getModelObject(); Catalog catalog = GeoServerApplication.get().getCatalog(); CoverageInfo ci = catalog.getCoverageByName(coverageName); ReferencedEnvelope ri = ci.getNativeBoundingBox(); final GetCoverageRequest gc = WCSRequestBuilderPanel.this.getCoverage; gc.bounds = ri; gc.targetCRS = ri.getCoordinateReferenceSystem(); gc.sourceGridRange = null; describeLink.setEnabled(true); target.addComponent(WCSRequestBuilderPanel.this); } });
assertEquals(targetCRS, envelope.getCoordinateReferenceSystem()); ReferencedEnvelope nativeBounds = ci.getNativeBoundingBox(); ReferencedEnvelope expected = nativeBounds.transform(targetCRS, true);
start("wcs:domainSet"); start("wcs:spatialDomain"); handleBoundingBox(ci.getSRS(), ci.getNativeBoundingBox(), timeInfo, dimensions); handleGrid(ci); end("wcs:spatialDomain");
/** * This method returns {@code true} in case we have POSTed a Coverage object with the name only, * as an instance when configuring a new coverage which has just been harvested. * * @param coverage */ private boolean isNewCoverage(CoverageInfo coverage) { return coverage.getName() != null && (coverage.isAdvertised()) && (!coverage.isEnabled()) && (coverage.getAlias() == null) && (coverage.getCRS() == null) && (coverage.getDefaultInterpolationMethod() == null) && (coverage.getDescription() == null) && (coverage.getDimensions() == null) && (coverage.getGrid() == null) && (coverage.getInterpolationMethods() == null) && (coverage.getKeywords() == null) && (coverage.getLatLonBoundingBox() == null) && (coverage.getMetadata() == null) && (coverage.getNativeBoundingBox() == null) && (coverage.getNativeCRS() == null) && (coverage.getNativeFormat() == null) && (coverage.getProjectionPolicy() == null) && (coverage.getSRS() == null) && (coverage.getResponseSRS() == null) && (coverage.getRequestSRS() == null); }