예제 #1
0
        protected static AVList wcsGetParamsFromCapsDoc(WCS100Capabilities caps, AVList parameters)
        {
            if (caps == null)
            {
                String message = Logging.getMessage("nullValue.WCSCapabilities");
                Logging.logger().severe(message);
                throw new ArgumentException(message);
            }

            if (parameters == null)
            {
                String message = Logging.getMessage("nullValue.ElevationModelConfigParams");
                Logging.logger().severe(message);
                throw new ArgumentException(message);
            }

            WCS100DescribeCoverage coverage = (WCS100DescribeCoverage)parameters.getValue(AVKey.DOCUMENT);

            if (coverage == null)
            {
                String message = Logging.getMessage("nullValue.WCSDescribeCoverage");
                Logging.logger().severe(message);
                throw new ArgumentException(message);
            }

            getWCSElevationModelConfigParams(caps, coverage, parameters);

            wcsSetFallbacks(parameters);
            determineNumLevels(coverage, parameters);

            parameters.setValue(AVKey.TILE_URL_BUILDER, new URLBuilder(caps.getVersion(), parameters));

            if (parameters.getValue(AVKey.ELEVATION_EXTREMES_FILE) == null)
            {
                // Use the default extremes file if there are at least as many levels in this new elevation model as the
                // level of the extremes file, which is level 5.
                int numLevels = (int)parameters.getValue(AVKey.NUM_LEVELS);
                if (numLevels >= 6)
                {
                    parameters.setValue(AVKey.ELEVATION_EXTREMES_FILE, "config/SRTM30Plus_ExtremeElevations_5.bil");
                }
            }

            return(parameters);
        }
예제 #2
0
        public static AVList getWCSElevationModelConfigParams(WCS100Capabilities caps, WCS100DescribeCoverage coverage,
                                                              AVList parameters)
        {
            DataConfigurationUtils.getWCSConfigParameters(caps, coverage, parameters); // checks for null args

            // Ensure that we found all the necessary information.
            if (parameters.getStringValue(AVKey.DATASET_NAME) == null)
            {
                Logging.logger().warning(Logging.getMessage("WCS.NoCoverageName"));
                throw new WWRuntimeException(Logging.getMessage("WCS.NoCoverageName"));
            }

            if (parameters.getStringValue(AVKey.SERVICE) == null)
            {
                Logging.logger().warning(Logging.getMessage("WCS.NoGetCoverageURL"));
                throw new WWRuntimeException(Logging.getMessage("WCS.NoGetCoverageURL"));
            }

            if (parameters.getStringValue(AVKey.DATA_CACHE_NAME) == null)
            {
                Logging.logger().warning(Logging.getMessage("nullValue.DataCacheIsNull"));
                throw new WWRuntimeException(Logging.getMessage("nullValue.DataCacheIsNull"));
            }

            if (parameters.getStringValue(AVKey.IMAGE_FORMAT) == null)
            {
                Logging.logger().severe("WCS.NoImageFormats");
                throw new WWRuntimeException(Logging.getMessage("WCS.NoImageFormats"));
            }

            if (parameters.getValue(AVKey.SECTOR) == null)
            {
                Logging.logger().severe("WCS.NoLonLatEnvelope");
                throw new WWRuntimeException(Logging.getMessage("WCS.NoLonLatEnvelope"));
            }

            if (parameters.getStringValue(AVKey.COORDINATE_SYSTEM) == null)
            {
                String msg = Logging.getMessage("WCS.RequiredCRSNotSupported", "EPSG:4326");
                Logging.logger().severe(msg);
                throw new WWRuntimeException(msg);
            }

            return(parameters);
        }
예제 #3
0
 /**
  * Implemented by subclasses to perform the actual object creation. This default implementation always returns
  * null.
  *
  * @param caps   the capabilities document.
  * @param parameters a list of configuration properties. These properties override any specified in the capabilities
  *               document.
  *
  * @return the requested object.
  */
 protected object doCreateFromCapabilities(WCS100Capabilities caps, AVList parameters)
 {
     return(null);
 }
예제 #4
0
 public WCSElevationModel(WCS100Capabilities caps, AVList parameters)
     : base(wcsGetParamsFromCapsDoc(caps, parameters))
 {
 }
 protected Object doCreateFromCapabilities(WCS100Capabilities caps, AVList parameters)
 {
     return(new WCSElevationModel(caps, parameters));
 }