Package org.geoserver.catalog.util

Examples of org.geoserver.catalog.util.ReaderDimensionsAccessor


    private final static WCSDimensionsValueParser PARSER = new WCSDimensionsValueParser();

    public WCSDefaultValuesHelper(GridCoverage2DReader reader, ReaderDimensionsAccessor accessor, GetCoverageType request, String coverageName) throws IOException {
        super();
        this.accessor = accessor == null ? new ReaderDimensionsAccessor(reader) : accessor; // Force the creation of an accessor
        this.reader = reader;
        this.request = request;
        this.coverageName = coverageName;
    }
View Full Code Here


        // add the descriptors for custom dimensions
        Set<ParameterDescriptor<List>> dynamicParameters = reader.getDynamicParameters();
        parameterDescriptors.addAll(dynamicParameters);

        final ReaderDimensionsAccessor dimensions = new ReaderDimensionsAccessor(reader);
        final MetadataMap metadata = coverageInfo.getMetadata();

        // Setup small envelope to get a piece of coverage to retrieve stats
        final ReferencedEnvelope testEnvelope = createTestEnvelope(coverageInfo);
        final GridGeometry2D gridGeometry = new GridGeometry2D(new GridEnvelope2D(new Rectangle(0, 0, 2,
View Full Code Here

                throw new RuntimeException("Unable to acquire reader for this coverageinfo: "
                        + ci.getName());
            }

            // inspect dimensions
            final ReaderDimensionsAccessor ra = new ReaderDimensionsAccessor(reader);
            for (String domain : ra.getCustomDomains()) {
                if (LOGGER.isLoggable(Level.FINE)) {
                    boolean hasRange = ra.hasRange(domain);
                    boolean hasResolution = ra.hasResolution(domain);
                    LOGGER.fine(ci.getName() + ": found " + domain + " dimension (hasRange: "
                            + hasRange + ", hasResolution: " + hasResolution + ")");
                }

                DimensionInfo dimension = new DimensionInfoImpl();
View Full Code Here

     * @param coverageId
     * @throws IOException
     */
    public WCSDimensionsHelper(CoverageInfo ci) throws IOException {
        this.coverageId = NCNameResourceCodec.encode(ci);
        this.accessor = new ReaderDimensionsAccessor((GridCoverage2DReader) ci.getGridCoverageReader(null, null));

        Map<String, DimensionInfo> dimensions = new HashMap<String, DimensionInfo>();
        for (Map.Entry<String, Serializable> entry : ci.getMetadata().entrySet()) {
            if(entry.getValue() instanceof DimensionInfo) {
                dimensions.put(entry.getKey(), (DimensionInfo) entry.getValue());
View Full Code Here

            }
        }, reader, coverageId);
    }

    public WCSDimensionsHelper(final Map<String, DimensionInfo> dimensions, final GridCoverage2DReader reader, final String coverageId) throws IOException {
        this.accessor = new ReaderDimensionsAccessor(reader);
        this.coverageId = coverageId;

        if (dimensions != null && !dimensions.isEmpty()) {
            initDimensions(dimensions);
        }
View Full Code Here

        this.envelopeDimensionsMapper = envelopeDimensionsMapper;
        timeDimension = enabledDimensions.get(ResourceInfo.TIME);
        elevationDimension = enabledDimensions.get(ResourceInfo.ELEVATION);

        if (timeDimension != null || elevationDimension != null || !enabledDimensions.isEmpty()) {
            accessor = new ReaderDimensionsAccessor(reader);
        }
    }
View Full Code Here

    String coverageId;

    public TimeDimensionHelper(DimensionInfo timeDimension, GridCoverage2DReader reader, String coverageId) throws IOException {
        this.timeDimension = timeDimension;
        this.accessor = new ReaderDimensionsAccessor(reader);
        this.coverageId = coverageId;

        if (timeDimension.getResolution() != null) {
            setupResolution(timeDimension.getResolution());
        }
View Full Code Here

            DimensionInfo dimension, Class<T> clz) {
        Object retval = null;
        try {
            GridCoverage2DReader reader = (GridCoverage2DReader) ((CoverageInfo) resource)
                    .getGridCoverageReader(null, null);
            ReaderDimensionsAccessor dimAccessor = new ReaderDimensionsAccessor(reader);

            if (dimensionName.equals(ResourceInfo.TIME)) {
                retval = dimAccessor.getMinTime();
            } else if (dimensionName.equals(ResourceInfo.ELEVATION)) {
                retval = dimAccessor.getMinElevation();          
            } else if (dimensionName.startsWith(ResourceInfo.CUSTOM_DIMENSION_PREFIX)){
                String custDimName = dimensionName.substring(ResourceInfo.CUSTOM_DIMENSION_PREFIX.length());
                // see if we have an optimize way to get the minimum
                String min = reader.getMetadataValue(custDimName.toUpperCase()
                        + "_DOMAIN_MINIMUM");
                if (min != null) {
                    retval = min;
                }
                else {                       

                // ok, get the full domain then
                List<String> domain = dimAccessor.getDomain(custDimName);

                if (domain.isEmpty()) {
                    retval = null;
                } else {
                    //Just a lexical (string) sort.
View Full Code Here

            DimensionInfo dimension, Class<T> clz) {
        Object retval = null;
        try {
            GridCoverage2DReader reader = (GridCoverage2DReader) ((CoverageInfo) resource)
                    .getGridCoverageReader(null, null);
            ReaderDimensionsAccessor dimAccessor = new ReaderDimensionsAccessor(reader);
          
            if (dimensionName.equals(ResourceInfo.TIME)) {
                retval = dimAccessor.getMaxTime();
            } else if (dimensionName.equals(ResourceInfo.ELEVATION)) {
                retval = dimAccessor.getMaxElevation();
            } else if (dimensionName.startsWith(ResourceInfo.CUSTOM_DIMENSION_PREFIX)){
                String custDimName = dimensionName.substring(ResourceInfo.CUSTOM_DIMENSION_PREFIX.length());
                // see if we have an optimize way to get the minimum
                String maximum = reader.getMetadataValue(custDimName.toUpperCase()
                        + "_DOMAIN_MAXIMUM");
                if (maximum != null) {
                    retval = maximum;
                }
                else {
                    // ok, get the full domain then
                    List<String> domain = dimAccessor.getDomain(custDimName);

                    if (domain.isEmpty()) {
                        retval = null;
                    } else {
                        //Just a lexical (string) sort.
View Full Code Here

            DimensionInfo dimension, Class<T> clz) {   
        Object retval = null;
        try {
            GridCoverage2DReader reader = (GridCoverage2DReader) ((CoverageInfo) resource)
                    .getGridCoverageReader(null, null);
            ReaderDimensionsAccessor dimAccessor = new ReaderDimensionsAccessor(reader);

            if (dimensionName.equals(ResourceInfo.TIME)) {
                Date dateToMatch = null;
                if (this.toMatch instanceof Date) {
                    dateToMatch = (Date) this.toMatch;
View Full Code Here

TOP

Related Classes of org.geoserver.catalog.util.ReaderDimensionsAccessor

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.