Package org.geoserver.wcs2_0

Examples of org.geoserver.wcs2_0.WCSMultiDimSubsetTest


                    dimensionsHelper = new WCSDimensionsHelper(dimensionsMap, RequestUtils.getCoverageReader(ci), encodedId);
                }

                GridCoverage2DReader reader = (GridCoverage2DReader) ci.getGridCoverageReader(null, null);
                if (reader== null) {
                    throw new WCS20Exception("Unable to read sample coverage for " + ci.getName());
                }
                // get the crs and look for an EPSG code
                final CoordinateReferenceSystem crs = reader.getCoordinateReferenceSystem();
                List<String> axesNames = envelopeDimensionsMapper.getAxesNames(
                        reader.getOriginalEnvelope(), true);
View Full Code Here


    @SuppressWarnings("unchecked")
    protected GetCoverageType parse(String url) throws Exception {
        Map<String, Object> rawKvp = new CaseInsensitiveMap(KvpUtils.parseQueryString(url));
        Map<String, Object> kvp = new CaseInsensitiveMap(parseKvp(rawKvp));
        WCS20GetCoverageRequestReader reader = new WCS20GetCoverageRequestReader();
        GetCoverageType gc = (GetCoverageType) reader.createRequest();
        return (GetCoverageType) reader.read(gc, kvp, rawKvp);
    }
View Full Code Here

        // TODO: We need to support more CRS

        // Loop over dimensions
        Dimension boundDimension = null;
        for (NetCDFDimensionManager manager : dimensionMapping.values()) {
            final DimensionBean dim = manager.getCoverageDimension();
            final boolean isRange = dim.isRange();
            String dimensionName = manager.getName();
            final int dimensionLength = getDimensionSize(dimensionName);
            if (dimensionName.equalsIgnoreCase("TIME") || dimensionName.equalsIgnoreCase("ELEVATION")) {
                // Special management for TIME and ELEVATION dimensions
                // we will put these dimension lowercase for NetCDF names
                dimensionName = dimensionName.toLowerCase();
            }
            if (isRange) {
                if (boundDimension == null) {
                    boundDimension = writer.addDimension(null, NCUtilities.BOUNDARY_DIMENSION, 2);
                }
            }
            final Dimension netcdfDimension = writer.addDimension(null, dimensionName, dimensionLength);
            manager.setNetCDFDimension(netcdfDimension);

            // Assign variable to dimensions having coordinates
            Variable var = writer.addVariable(null, dimensionName,
                    NCUtilities.getNetCDFDataType(dim.getDatatype()), dimensionName);
            writer.addVariableAttribute(var, new Attribute(NCUtilities.LONGNAME, dimensionName));
            writer.addVariableAttribute(var, new Attribute(NCUtilities.DESCRIPTION, dimensionName));
            // TODO: introduce some lookup table to get a description if needed

            if (NCUtilities.isATime(dim.getDatatype())) {
                // Special management for times. We use the NetCDF convention of defining times starting from
                // an origin. Right now we use the Linux EPOCH
                writer.addVariableAttribute(var, new Attribute(NCUtilities.UNITS, NCUtilities.TIME_ORIGIN));
            } else {
                writer.addVariableAttribute(var, new Attribute(NCUtilities.UNITS, dim.getSymbol()));
            }

            // Add bounds variable for ranges
            if (isRange) {
                final List<Dimension> boundsDimensions = new ArrayList<Dimension>();
                boundsDimensions.add(netcdfDimension);
                boundsDimensions.add(boundDimension);
                final String boundName = dimensionName + NCUtilities.BOUNDS_SUFFIX;
                writer.addVariableAttribute(var, new Attribute(NCUtilities.BOUNDS, boundName));
                writer.addVariable(null, boundName, NCUtilities.getNetCDFDataType(dim.getDatatype()), boundsDimensions);
            }
        }

        setupCoordinates();
    }
View Full Code Here

            }
            // Writing coordinate variable values
            writer.write(var, manager.getDimensionData(false));

            // handle ranges
            DimensionBean coverageDimension = manager.getCoverageDimension();
            if (coverageDimension != null) { // lat and lon may be null
                boolean isRange = coverageDimension.isRange();
                if (isRange) {
                    var = writer.findVariable(dimensionName + NCUtilities.BOUNDS_SUFFIX);
                    writer.write(var, manager.getDimensionData(true));
                }
            }
View Full Code Here

        int i = 0;
        int dimElement = 0;
        final Map properties = currentCoverage.getProperties();
        for (NetCDFDimensionManager manager : dimensionMapping.values()) {
            // Loop over dimensions
            final DimensionBean coverageDimension = manager.getCoverageDimension();
            if (coverageDimension != null) { // Lat and lon doesn't have a Coverage dimension
                final String dimensionName = manager.getName();

                // Get the current value for that dimension for this coverage
                final Object val = properties.get(dimensionName);
View Full Code Here

        } else if (dimensionName.equalsIgnoreCase(NCUtilities.LON)) {
            return (Array) getDimensionValues().getValues();
        } else {

            // Get Dimension information
            DimensionBean bean = getCoverageDimension();
            DimensionType type = bean.getDimensionType();
            final String dataType = bean.getDatatype();
            boolean isTime = false;
            if (type == DimensionType.TIME || NCUtilities.isATime(dataType)) {
                isTime = true;
            }
View Full Code Here

            // Set the input coverage dimension
            manager.setCoverageDimension(dimension);

            // Set the dimension values type
            final DimensionType dimensionType = dimension.getDimensionType();
            final boolean isRange = dimension.isRange();
            TreeSet<Object> tree = null;
            switch (dimensionType) {
            case TIME:
                tree = new TreeSet(new DateRangeComparator());
View Full Code Here

                    " for the specified coverage " + coverageName + "\n Returning no DimensionBean");
           }
           return null;
        }
        final String dimensionName = descriptor.getName();
        final DimensionType dimensionType = dimensionID.equalsIgnoreCase("TIME") ? DimensionType.TIME : dimensionID.equalsIgnoreCase("ELEVATION") ? DimensionType.ELEVATION : DimensionType.CUSTOM;
        final DimensionInfo info = enabledDimensions.get(dimensionID);
        String units = null;
        String symbol = null;
        if (info != null) {
            units = info.getUnits();
View Full Code Here

     * @param coverageDimension
     */
    public void setCoverageDimensionProperty(Map properties, GridCoverageRequest coverageRequest, DimensionBean coverageDimension) {
        Utilities.ensureNonNull("properties", properties);
        Utilities.ensureNonNull("coverageDimension", coverageDimension);
        final DimensionType dimensionType = coverageDimension.getDimensionType();
        Object value = null;
        switch (dimensionType) {
        case TIME:
            value = coverageRequest.getTemporalSubset();
            break;
View Full Code Here

            return (Array) getDimensionValues().getValues();
        } else {

            // Get Dimension information
            DimensionBean bean = getCoverageDimension();
            DimensionType type = bean.getDimensionType();
            final String dataType = bean.getDatatype();
            boolean isTime = false;
            if (type == DimensionType.TIME || NCUtilities.isATime(dataType)) {
                isTime = true;
            }
View Full Code Here

TOP

Related Classes of org.geoserver.wcs2_0.WCSMultiDimSubsetTest

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.