Package org.geoserver.catalog

Examples of org.geoserver.catalog.DimensionInfo


     * @param resolution
     */
    protected void setupRasterDimension(String coverageName, String metadataKey,
            DimensionPresentation presentation, Double resolution) {
        CoverageInfo info = getCatalog().getCoverageByName(coverageName);
        DimensionInfo di = new DimensionInfoImpl();
        di.setEnabled(true);
        di.setPresentation(presentation);
        if (resolution != null) {
            di.setResolution(new BigDecimal(resolution));
        }
        info.getMetadata().put(metadataKey, di);
        getCatalog().save(info);
    }
View Full Code Here


                    // the dataset series id
                    element("wcseo:DatasetSeriesId", datasetId);

                    // encode the time
                    DimensionInfo time = ci.getMetadata().get(ResourceInfo.TIME, DimensionInfo.class);
                    WCSDimensionsHelper timeHelper = new WCSDimensionsHelper(time, reader, datasetId);
                    dcTranslator.encodeTimePeriod(timeHelper.getBeginTime(), timeHelper.getEndTime(), datasetId + "_timeperiod", null, null);

                    end("wcseo:DatasetSeriesDescription");
                } catch (IOException e) {
View Full Code Here

            }
            // select only those that have been activated vai the GeoServer GUI
            List<DimensionDescriptor> enabledDescriptors = new ArrayList<DimensionDescriptor>();
            for(Entry<String, Serializable> entry : ci.getMetadata().entrySet()) {
                if(entry.getValue() instanceof DimensionInfo) {
                    DimensionInfo di = (DimensionInfo) entry.getValue();
                    if(di.isEnabled()) {
                        String dimensionName = entry.getKey();
                        if(dimensionName.startsWith(ResourceInfo.CUSTOM_DIMENSION_PREFIX)) {
                            dimensionName = dimensionName.substring(ResourceInfo.CUSTOM_DIMENSION_PREFIX.length());
                        }
                        DimensionDescriptor selected = sourceDescriptors.get(dimensionName.toUpperCase());
View Full Code Here

        if (!(context instanceof CoverageInfo) || !isEarthObservationEnabled()) {
            return;
        }

        CoverageInfo ci = (CoverageInfo) context;
        DimensionInfo time = ci.getMetadata().get(ResourceInfo.TIME, DimensionInfo.class);
        if (time == null) {
            LOGGER.log(Level.FINE, "We received a coverage info that has no " +
                "associated time, cannot add EO metadata to it: "+ ci.prefixedName());
            return;
        }
View Full Code Here

     * @param ci
     * @return
     */
    public boolean isValidDataset(CoverageInfo ci) {
        Boolean dataset = ci.getMetadata().get(WCSEOMetadata.DATASET.key, Boolean.class);
        DimensionInfo time = ci.getMetadata().get(ResourceInfo.TIME, DimensionInfo.class);
        try {
            GridCoverageReader reader = ci.getGridCoverageReader(null, GeoTools.getDefaultHints());
            boolean structured = reader instanceof StructuredGridCoverage2DReader;
            return dataset != null && dataset && time != null && time.isEnabled()
                    && structured;
        } catch (IOException e) {
            throw new ServiceException("Failed to locate the grid coverage reader for coverage " + ci.prefixedName());
        }
    }
View Full Code Here

            return;
        }
       
        for (CoverageInfo ci : coverages) {
            Boolean dataset = ci.getMetadata().get(WCSEOMetadata.DATASET.key, Boolean.class);
            DimensionInfo time = ci.getMetadata().get(ResourceInfo.TIME, DimensionInfo.class);
            if(dataset != null && dataset && time != null && time.isEnabled()) {
                tx.start("wcseo:DatasetSeriesSummary");
                ReferencedEnvelope bbox = ci.getLatLonBoundingBox();
                tx.start("ows:WGS84BoundingBox");
                element(tx, "ows:LowerCorner", bbox.getMinX() + " " + bbox.getMinY(), null);
                element(tx, "ows:UpperCorner", bbox.getMaxX() + " " + bbox.getMaxY(), null);
View Full Code Here

            final Map<String, DimensionInfo> additionalDimensions = helper.getAdditionalDimensions();
            final Set<String> dimensionsName = additionalDimensions.keySet();
            final Iterator<String> dimensionsIterator = dimensionsName.iterator();
            while (dimensionsIterator.hasNext()) {
                final String dimensionName = dimensionsIterator.next();
                final DimensionInfo customDimension = additionalDimensions.get(dimensionName);
                if (customDimension != null) {
                    setAdditionalDimensionMetadata(dimensionName, customDimension, helper);
                }
            }
        }
View Full Code Here

         * @param helper
         * @throws IOException
         */
        private void handleTimeMetadata(WCSDimensionsHelper helper) throws IOException {
            Utilities.ensureNonNull("helper", helper);
            final DimensionInfo timeDimension = helper.getTimeDimension();
            if (timeDimension != null) {
                start(initStartMetadataTag(TAG.TIME_DOMAIN, null, timeDimension, helper));
                final DimensionPresentation presentation = timeDimension.getPresentation();
                final String id = helper.getCoverageId();
                switch(presentation) {
                    case CONTINUOUS_INTERVAL:
                        encodeTimePeriod(helper.getBeginTime(), helper.getEndTime(), id + "_tp_0", null, null);
                        break;
View Full Code Here

         * @param helper
         * @throws IOException
         */
        private void handleElevationMetadata(WCSDimensionsHelper helper) throws IOException {
            // Null check has been performed in advance
            final DimensionInfo elevationDimension = helper.getElevationDimension();
            if (elevationDimension != null) {
                start(initStartMetadataTag(TAG.ELEVATION_DOMAIN, null, elevationDimension, helper));
                final DimensionPresentation presentation = elevationDimension.getPresentation();
                switch(presentation) {
                    // Where _er_ means elevation range
                    case CONTINUOUS_INTERVAL:
                        encodeInterval(helper.getBeginElevation(), helper.getEndElevation(), null, null);
                        break;
View Full Code Here

        LayerInfo l = context.getTasks().get(0).getLayer();
        ResourceInfo r = l.getResource();
        assertTrue(r.getMetadata().containsKey("time"));

        DimensionInfo d = (DimensionInfo) r.getMetadata().get("time");
        assertNotNull(d);

        runChecks(l.getName());

        Document dom = getAsDOM(String.format("/%s/%s/wms?request=getcapabilities",
View Full Code Here

TOP

Related Classes of org.geoserver.catalog.DimensionInfo

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.