Package org.geotools.coverage.io.CoverageSource

Examples of org.geotools.coverage.io.CoverageSource.VerticalDomain


        String value = null;
        NetCDFSource source = null;
        try {
            source = (NetCDFSource) getGridCoverageSource(coverageName);
            final TemporalDomain timeDomain = source.getTemporalDomain();
            final VerticalDomain verticalDomain = source.getVerticalDomain();
           
            final List<AdditionalDomain> additionalDomains = source.getAdditionalDomains();
            final boolean hasAdditionalDomains = additionalDomains != null && !additionalDomains.isEmpty();
            final boolean hasTimeDomain = timeDomain != null;
            final boolean hasElevationDomain = verticalDomain != null;
View Full Code Here


    private String parseDomain(String name, Object domain) throws IOException {
        name = name.toLowerCase();
        if (domain instanceof VerticalDomain) {
           
            // Vertical domain management
            VerticalDomain verticalDomain = (VerticalDomain) domain;
            if (name.endsWith("domain")) {
               
                // global domain
                SortedSet<? extends NumberRange<Double>> verticalElements = verticalDomain.getVerticalElements(true, null);
                return buildVerticalList(verticalElements);
            } else if (name.endsWith("datatype")) {
                return Double.class.getName();
            } else {
                // min or max requests
                SortedSet<? extends NumberRange<Double>> verticalElements = verticalDomain.getVerticalElements(false, null);
                NumberRange<Double> overall = verticalElements.iterator().next();
                if (name.endsWith("maximum")) {
                    return Double.toString(overall.getMaximum());
                } else if (name.endsWith("minimum")) {
                    return Double.toString(overall.getMinimum());
View Full Code Here

                        }
                        LOGGER.info(overallTemporal.toString());
                    }

                    // VERTICAL DOMAIN
                    final VerticalDomain verticalDomain = gridSource.getVerticalDomain();
                    if (verticalDomain == null) {
                        LOGGER.info("Vertical domain is null");
                    } else {
                        // vertical crs
                        LOGGER.info("VerticalCRS: " + verticalDomain.getCoordinateReferenceSystem());

                        // print the Vertical domain elements
                        for (NumberRange<Double> vg : verticalDomain.getVerticalElements(true, null)) {
                            LOGGER.info("Vertical domain element: " + vg.toString());
                        }

                        // print the Vertical domain elements with overall = true
                        StringBuilder overallVertical = new StringBuilder("Vertical domain element (overall = true):\n");
                        for (NumberRange<Double> vg : verticalDomain.getVerticalElements(false, null)) {
                            overallVertical.append(vg.toString()).append("\n");
                        }
                        LOGGER.info(overallVertical.toString());
                    }

                    // HORIZONTAL DOMAIN
                    final SpatialDomain spatialDomain = gridSource.getSpatialDomain();
                    if (spatialDomain == null) {
                        LOGGER.info("Horizontal domain is null");
                    } else {
                        // print the horizontal domain elements
                        final CoordinateReferenceSystem crs2D = spatialDomain.getCoordinateReferenceSystem2D();
                        assert crs2D != null;
                        final MathTransform2D g2w = spatialDomain.getGridToWorldTransform(null);
                        assert g2w != null;
                        final Set<? extends BoundingBox> spatialElements = spatialDomain.getSpatialElements(true, null);
                        assert spatialElements != null && !spatialElements.isEmpty();

                        final StringBuilder buf = new StringBuilder();
                        buf.append("Horizontal domain is as follows:\n");
                        buf.append("G2W:").append("\t").append(g2w).append("\n");
                        buf.append("CRS2D:").append("\t").append(crs2D).append("\n");
                        for (BoundingBox bbox : spatialElements) {
                            buf.append("BBOX:").append("\t").append(bbox).append("\n");
                        }
                        LOGGER.info(buf.toString());
                    }

                    CoverageReadRequest readRequest = new CoverageReadRequest();
                    // //
                    //
                    // Setting up a limited range for the request.
                    //
                    // //

                    LinkedHashSet<NumberRange<Double>> requestedVerticalSubset = new LinkedHashSet<NumberRange<Double>>();
                    SortedSet<? extends NumberRange<Double>> verticalElements = verticalDomain
                            .getVerticalElements(false, null);
                    final int numLevels = verticalElements.size();
                    final Iterator<? extends NumberRange<Double>> iterator = verticalElements.iterator();
                    for (int i = 0; i < numLevels; i++) {
                        NumberRange<Double> level = iterator.next();
View Full Code Here

                      LOGGER.info("TemporalGeometricPrimitive: "+tg.toString());
                    }
                  }
                 
                  // VERTICAL DOMAIN
                  final VerticalDomain verticalDomain= gridSource.getVerticalDomain();
                  if(verticalDomain==null || verticalDomain.getVerticalElements(true, null).isEmpty())
                    LOGGER.info("Vertical domain is null");
                  else{
                    // vertical  crs
                    LOGGER.info("VerticalCRS: "+verticalDomain.getCoordinateReferenceSystem());
                   
                    // print the temporal domain elements
                    for(NumberRange<Double> vg:verticalDomain.getVerticalElements(true, null)){
                      LOGGER.info("Vertical domain element: "+vg.toString());
                    }
                  }
                 
                 
View Full Code Here

TOP

Related Classes of org.geotools.coverage.io.CoverageSource.VerticalDomain

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.