public CoordinateReferenceSystem getNativeCRS() { return delegate.getNativeCRS(); }
+ csinfo.getFormat().getName()); if (cinfo.getNativeCRS() == null) { cinfo.setNativeCRS(reader.getCoordinateReferenceSystem()); CoordinateReferenceSystem nativeCRS = cinfo.getNativeCRS(); } 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 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()); }
@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()); }
assertTrue(cv.getParameters().containsKey("foo")); assertNull(cv.getParameters().get("foo")); assertTrue(CRS.equalsIgnoreMetadata(CRS.decode("EPSG:4326"), cv.getNativeCRS()));
if ((cinfo.getProjectionPolicy() == ProjectionPolicy.NONE) || (cinfo.getProjectionPolicy() == ProjectionPolicy.REPROJECT_TO_DECLARED)) { targetCRS = cinfo.getNativeCRS(); } else { targetCRS = cinfo.getCRS();
/** * 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); }