Пример #1
0
 /**
  * Returns the default value for elevation dimension.
  *
  * @param resourceInfo
  * @return
  */
 public Double getDefaultElevation(ResourceInfo resourceInfo) {
   DimensionInfo elevation =
       resourceInfo.getMetadata().get(ResourceInfo.ELEVATION, DimensionInfo.class);
   if (elevation == null || !elevation.isEnabled()) {
     throw new ServiceException(
         "Layer " + resourceInfo.prefixedName() + " does not have elevation support enabled");
   }
   DimensionDefaultValueSelectionStrategy strategy =
       this.getDefaultValueStrategy(resourceInfo, ResourceInfo.ELEVATION, elevation);
   return strategy.getDefaultValue(resourceInfo, ResourceInfo.ELEVATION, elevation, Double.class);
 }
Пример #2
0
 /**
  * Returns the default value for time dimension.
  *
  * @param resourceInfo
  * @return
  */
 public Date getDefaultTime(ResourceInfo resourceInfo) {
   // check the time metadata
   DimensionInfo time = resourceInfo.getMetadata().get(ResourceInfo.TIME, DimensionInfo.class);
   if (time == null || !time.isEnabled()) {
     throw new ServiceException(
         "Layer " + resourceInfo.prefixedName() + " does not have time support enabled");
   }
   DimensionDefaultValueSelectionStrategy strategy =
       this.getDefaultValueStrategy(resourceInfo, ResourceInfo.TIME, time);
   return strategy.getDefaultValue(resourceInfo, ResourceInfo.TIME, time, Date.class);
 }
Пример #3
0
 /**
  * Returns the default value for the given custom dimension.
  *
  * @param <T>
  * @param dimensionName
  * @param resourceInfo
  * @param clz
  * @return
  */
 public <T> T getDefaultCustomDimensionValue(
     String dimensionName, ResourceInfo resourceInfo, Class<T> clz) {
   DimensionInfo customDim =
       resourceInfo
           .getMetadata()
           .get(ResourceInfo.CUSTOM_DIMENSION_PREFIX + dimensionName, DimensionInfo.class);
   if (customDim == null || !customDim.isEnabled()) {
     throw new ServiceException(
         "Layer "
             + resourceInfo.prefixedName()
             + " does not have support enabled for dimension "
             + dimensionName);
   }
   DimensionDefaultValueSelectionStrategy strategy =
       this.getDefaultValueStrategy(
           resourceInfo, ResourceInfo.CUSTOM_DIMENSION_PREFIX + dimensionName, customDim);
   return strategy.getDefaultValue(
       resourceInfo, ResourceInfo.CUSTOM_DIMENSION_PREFIX + dimensionName, customDim, clz);
 }