Package org.geoserver.catalog

Examples of org.geoserver.catalog.CoverageDimensionInfo


            coverage.setGrid( new GridGeometry2D(range, gridEnvelope) );
        }
       
        for ( Iterator x = cInfoReader.coverageDimensions().iterator(); x   .hasNext(); ) {
            Map map = (Map) x.next();
            CoverageDimensionInfo cd = factory.createCoverageDimension();
            cd.setName((String)map.get("name"));
            cd.setDescription((String)map.get("description"));
            cd.setRange(
               new NumberRange((Double)map.get("min"),(Double)map.get("max"))
            );
            coverage.getDimensions().add( cd );
        }
       
View Full Code Here


            final CoverageInfo coverageInfo = geoserverCatalog.getCoverageByName(new NameImpl(
                    layerID.substring(0, indexOf), layerID.substring(indexOf + 1)));
            List<CoverageDimensionInfo> dimensions = coverageInfo.getDimensions();
            String unit = "";
            if (dimensions != null && !dimensions.isEmpty()) {
                CoverageDimensionInfo dimensionInfo = dimensions.get(0);
                unit = dimensionInfo.getUnit();
            }

            // Getting coverage to parse statistics
            final CoverageStoreInfo storeInfo = coverageInfo.getStore();
            final GridCoverage2DReader reader = (GridCoverage2DReader) geoserverCatalog
View Full Code Here

            coverage.setGrid( new GridGeometry2D(range, gridEnvelope) );
        }
       
        for ( Iterator x = cInfoReader.coverageDimensions().iterator(); x   .hasNext(); ) {
            Map map = (Map) x.next();
            CoverageDimensionInfo cd = factory.createCoverageDimension();
            cd.setName((String)map.get("name"));
            cd.setDescription((String)map.get("description"));
            cd.setRange(
               NumberRange.create( (Double)map.get("min"),(Double)map.get("max"))
            );
            coverage.getDimensions().add( cd );
        }
       
View Full Code Here

        testData.addRasterLayer(NO_RANGE, "norange.tiff", null, null, DescribeCoverageTest.class,
                getCatalog());
        // the GUI builds the dimension without range, let's do the same here
        CoverageInfo noRange = getCatalog().getCoverageByName(getLayerId(NO_RANGE));
        CoverageDimensionInfo cdi = noRange.getDimensions().get(0);
        cdi.setRange(null);
        getCatalog().save(noRange);
    }
View Full Code Here

        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(-9999, dimension.getRange().getMinimum(), 0d);
        // Huston, we have a problem here...
        // assertEquals(9999, dimension.getRange().getMaximum(), 0d);
        assertNull(dimension.getUnit());
    }
View Full Code Here

        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());
    }
View Full Code Here

    public void gmlFormatCoverageBandDetails() throws Exception {
        Catalog catalog = getCatalog();

        CoverageInfo c = catalog.getCoverageByName("wcs", "BlueMarble");
        List<CoverageDimensionInfo> dimensions = c.getDimensions();
        CoverageDimensionInfo dimension = dimensions.get(0);
        assertEquals("RED_BAND", dimension.getName());
        NumberRange range = dimension.getRange();
        assertEquals(Double.NEGATIVE_INFINITY, range.getMinimum(), DELTA);
        assertEquals(Double.POSITIVE_INFINITY, range.getMaximum(), DELTA);
        assertEquals("GridSampleDimension[-Infinity,Infinity]", dimension.getDescription());
        List<Double> nullValues = dimension.getNullValues();
        assertEquals(0, nullValues.size());
        assertEquals("W.m-2.Sr-1", dimension.getUnit());

        int i = 1;
        for (CoverageDimensionInfo dimensionInfo : dimensions) {
            // Updating dimension properties
            dimensionInfo.getNullValues().add(-999d);
View Full Code Here

        assertXpathEvaluatesTo("new title", "/coverage/title", dom );
       
        CoverageInfo c = catalog.getCoverageByName( "wcs", "tazdem");
        assertEquals( "new title", c.getTitle() );
        List<CoverageDimensionInfo> dimensions = c.getDimensions();
        CoverageDimensionInfo dimension = dimensions.get(0);
        assertEquals( "GRAY_INDEX", dimension.getName());
        NumberRange range = dimension.getRange();
        assertEquals( -9999.0, range.getMinimum(), DELTA);
        assertEquals( -9999.0, range.getMaximum(), DELTA);
        assertEquals("GridSampleDimension[-9999.0,-9999.0]", dimension.getDescription());
        List<Double> nullValues = dimension.getNullValues();
        assertEquals( -9999.0, nullValues.get(0), DELTA);
       
       
        // Updating dimension properties
        xml =
                "<coverage>" +
                  "<name>tazdem</name>" +
                  "<title>new title</title>" +
                  "<dimensions>" +
                      "<coverageDimension>" +
                          "<name>Elevation</name>" +
                          "<description>GridSampleDimension[-100.0,1000.0]</description>" +
                          "<nullValues>" +
                              "<double>-999</double>" +
                          "</nullValues>" +
                          "<range>" +
                              "<min>-100</min>" +
                              "<max>1000</max>" +
                          "</range>" +
                      "</coverageDimension>" +
                  "</dimensions>" +
                "</coverage>";
        response =
           putAsServletResponse("/rest/workspaces/wcs/coveragestores/DEM/coverages/tazdem", xml, "text/xml");
        assertEquals( 200, response.getStatusCode() );

        c = catalog.getCoverageByName( "wcs", "tazdem");
        dimensions = c.getDimensions();
        dimension = dimensions.get(0);
        assertEquals( "Elevation", dimension.getName());
        range = dimension.getRange();
        assertEquals( -100.0, range.getMinimum(), DELTA);
        assertEquals( 1000.0, range.getMaximum(), DELTA);
        assertEquals("GridSampleDimension[-100.0,1000.0]", dimension.getDescription());
        nullValues = dimension.getNullValues();
        assertEquals( -999.0, nullValues.get(0), DELTA);

        CoverageStoreInfo coverageStore = catalog.getStoreByName("wcs", "DEM", CoverageStoreInfo.class);
        GridCoverageReader reader = null;
        GridCoverage2D coverage = null;
View Full Code Here

            coverage.setGrid( new GridGeometry2D(range, gridEnvelope) );
        }
       
        for ( Iterator x = cInfoReader.coverageDimensions().iterator(); x   .hasNext(); ) {
            Map map = (Map) x.next();
            CoverageDimensionInfo cd = factory.createCoverageDimension();
            cd.setName((String)map.get("name"));
            cd.setDescription((String)map.get("description"));
            cd.setRange(
               new NumberRange((Double)map.get("min"),(Double)map.get("max"))
            );
            coverage.getDimensions().add( cd );
        }
       
View Full Code Here

TOP

Related Classes of org.geoserver.catalog.CoverageDimensionInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.