org.geotools.factory.Hints.containsKey()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(9.9k)|赞(0)|评价(0)|浏览(122)

本文整理了Java中org.geotools.factory.Hints.containsKey()方法的一些代码示例,展示了Hints.containsKey()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Hints.containsKey()方法的具体详情如下:
包路径:org.geotools.factory.Hints
类名称:Hints
方法名:containsKey

Hints.containsKey介绍

暂无

代码示例

代码示例来源:origin: locationtech/geowave

protected static final boolean isDistributedRenderQuery(final Query query) {
 return query.getHints().containsKey(DistributedRenderProcess.OPTIONS);
}

代码示例来源:origin: org.geoserver/gs-wcs2_0

/**
   * In case some scaling factor have been pre-applied, make sure to arrange the requested target
   * scaleFactors by taking into account the previous ones.
   *
   * <p>This is usually required when using overviews. Suppose you want to get a target
   * scaleFactor of 0.00001 and the worst overview provide you a scale factor of 0.0001, then the
   * current scaleFactor need to be adjusted by a remaining 0.1 factor.
   *
   * @param hints
   * @param scaleFactors
   * @return the arranged scaleFactor
   */
  private static double[] arrangeScaleFactors(Hints hints, final double[] scaleFactors) {
    if (hints != null && hints.containsKey(GetCoverage.PRE_APPLIED_SCALE)) {
      Double[] preAppliedScale = (Double[]) hints.get(GetCoverage.PRE_APPLIED_SCALE);
      if (preAppliedScale != null) {
        scaleFactors[0] = scaleFactors[0] * preAppliedScale[0];
        scaleFactors[1] = scaleFactors[1] * preAppliedScale[1];
      }
    }
    return scaleFactors;
  }
}

代码示例来源:origin: org.geotools/gt-jdbc

/**
 * Checks if reduction required and makes sense
 *       
 * @param hints      hints passed in 
 * @param gatt   Geometry attribute descriptor
 * @param param  {@link Hints#GEOMETRY_GENERALIZATION} or {@link Hints#GEOMETRY_SIMPLIFICATION}
 * @return true to indicate reducing the geometry, false otherwise
 */
protected boolean isGeometryReduceRequired(Hints hints, GeometryDescriptor gatt, Hints.Key param) {
  if (hints==null) return false;
  if (hints.containsKey(param)==false) return false;
  if (gatt.getType().getBinding() == Point.class)  
    return false;
  return true;    		
}

代码示例来源:origin: org.geotools/gt-imagemosaic

/**
   * This method is responsible for checking the decimation policy as defined by
   * the provided {@link Hints}.
   * 
   * @return the decimation policy which can be one of
   *         {@link DecimationPolicy#ALLOW},
   *         {@link DecimationPolicy#DISALLOW}.
   *         Default is {@link DecimationPolicy#ALLOW}.
   */
private DecimationPolicy extractDecimationPolicy() {
    if (this.hints != null)
      if (this.hints.containsKey(Hints.DECIMATION_POLICY))
        decimationPolicy = (DecimationPolicy) this.hints.get(Hints.DECIMATION_POLICY);

    // use default if not provided. Default is allow
    if (decimationPolicy == null) {
      decimationPolicy = DecimationPolicy.getDefaultPolicy();
    }
    assert decimationPolicy != null;
    return decimationPolicy;
  }

代码示例来源:origin: org.geotools/gt-jp2k

/**
 * This method is responsible for checking the overview policy as defined by
 * the provided {@link Hints}.
 * 
 * @return the overview policy which can be one of
 *         {@link Hints#VALUE_OVERVIEW_POLICY_IGNORE},
 *         {@link Hints#VALUE_OVERVIEW_POLICY_NEAREST},
 *         {@link Hints#VALUE_OVERVIEW_POLICY_SPEED}, {@link Hints#VALUE_OVERVIEW_POLICY_QUALITY}.
 *         Default is {@link Hints#VALUE_OVERVIEW_POLICY_NEAREST}.
 */
private OverviewPolicy extractOverviewPolicy() {
  
  if (this.hints != null)
    if (this.hints.containsKey(Hints.OVERVIEW_POLICY))
      overviewPolicy = (OverviewPolicy) this.hints.get(Hints.OVERVIEW_POLICY);

  // use default if not provided. Default is nearest
  if (overviewPolicy == null)
    overviewPolicy = OverviewPolicy.getDefaultPolicy();

  assert overviewPolicy != null;
  return overviewPolicy;
}

代码示例来源:origin: org.geotools/gt-coverage

/**
 * This method is responsible for checking the overview policy as defined by
 * the provided {@link Hints}.
 * 
 * @return the overview policy which can be one of
 *         {@link Hints#VALUE_OVERVIEW_POLICY_IGNORE},
 *         {@link Hints#VALUE_OVERVIEW_POLICY_NEAREST},
 *         {@link Hints#VALUE_OVERVIEW_POLICY_SPEED}, {@link Hints#VALUE_OVERVIEW_POLICY_QUALITY}.
 *         Default is {@link Hints#VALUE_OVERVIEW_POLICY_NEAREST}.
 */
private OverviewPolicy extractOverviewPolicy() {
  OverviewPolicy overviewPolicy=null;
  // check if a policy was provided using hints (check even the
  // deprecated one)
  if (this.hints != null)
    if (this.hints.containsKey(Hints.OVERVIEW_POLICY))
      overviewPolicy = (OverviewPolicy) this.hints.get(Hints.OVERVIEW_POLICY);
  // use default if not provided. Default is nearest
  if (overviewPolicy == null)
    overviewPolicy = OverviewPolicy.getDefaultPolicy();
  assert overviewPolicy != null;
  return overviewPolicy;
}

代码示例来源:origin: org.geotools/gt-imagemosaic

/**
 * This method is responsible for checking the overview policy as defined by
 * the provided {@link Hints}.
 * 
 * @return the overview policy which can be one of
 *         {@link OverviewPolicy#IGNORE},
 *         {@link OverviewPolicy#NEAREST},
 *         {@link OverviewPolicy#SPEED}, {@link OverviewPolicy#QUALITY}.
 *         Default is {@link OverviewPolicy#NEAREST}.
 */
private OverviewPolicy extractOverviewPolicy() {
  
  // check if a policy was provided using hints (check even the
  // deprecated one)
  if (this.hints != null)
    if (this.hints.containsKey(Hints.OVERVIEW_POLICY))
      overviewPolicy = (OverviewPolicy) this.hints.get(Hints.OVERVIEW_POLICY);

  // use default if not provided. Default is nearest
  if (overviewPolicy == null) {
    overviewPolicy = OverviewPolicy.getDefaultPolicy();
  }
  assert overviewPolicy != null;
  return overviewPolicy;
}

代码示例来源:origin: org.geotools.jdbc/gt-jdbc-postgis

@Override
public void encodeGeometryColumn(GeometryDescriptor gatt, String prefix, int srid, Hints hints, 
  StringBuffer sql) {

  boolean geography = "geography".equals(gatt.getUserData().get(
      JDBCDataStore.JDBC_NATIVE_TYPENAME));

  if (geography) {
    sql.append("encode(ST_AsBinary(");
    encodeColumnName(prefix, gatt.getLocalName(), sql);
    sql.append("),'base64')");
  }
  else {
    boolean force2D = hints != null && hints.containsKey(Hints.FEATURE_2D) && 
      Boolean.TRUE.equals(hints.get(Hints.FEATURE_2D));
    if (force2D) {
      sql.append("encode(ST_AsBinary(ST_Force_2D(");
      encodeColumnName(prefix, gatt.getLocalName(), sql);
      sql.append(")),'base64')");
    } else {
      sql.append("encode(ST_AsEWKB(");
      encodeColumnName(prefix, gatt.getLocalName(), sql);
      sql.append("),'base64')");
    }
  }
}

代码示例来源:origin: org.geotools/gt-imagemosaic

if (this.hints.containsKey(Hints.EXECUTOR_SERVICE)) {
 final Object executor = uHints.get(Hints.EXECUTOR_SERVICE);
 if (executor != null && executor instanceof ExecutorService){
if(this.hints.containsKey(Hints.MAX_ALLOWED_TILES))
  this.maxAllowedTiles= ((Integer)this.hints.get(Hints.MAX_ALLOWED_TILES));

代码示例来源:origin: org.geotools/gt-netcdf

/**
 * Scan the provided hints (if any) and look for auxiliary entries to be set into the reader.
 *
 * @param hints
 */
private void setAuxiliaryEntries(Hints hints) {
  String prefix = "";
  if (hints != null) {
    if (hints.containsKey(Utils.PARENT_DIR)) {
      prefix = (String) hints.get(Utils.PARENT_DIR) + File.separatorChar;
    }
    if (hints.containsKey(Utils.AUXILIARY_FILES_PATH)) {
      String filePath = (String) hints.get(Utils.AUXILIARY_FILES_PATH);
      filePath = makeAbsolute(prefix, filePath);
      reader.setAuxiliaryFilesPath(filePath);
    }
    if (hints.containsKey(Utils.AUXILIARY_DATASTORE_PATH)) {
      String filePath = (String) hints.get(Utils.AUXILIARY_DATASTORE_PATH);
      filePath = makeAbsolute(prefix, filePath);
      reader.setAuxiliaryDatastorePath(filePath);
    }
    if (hints.containsKey(Hints.REPOSITORY)) {
      reader.setRepository((Repository) hints.get(Hints.REPOSITORY));
    }
  }
}

代码示例来源:origin: locationtech/geowave

private ReferencedEnvelope getEnvelope(final Query query)
  throws TransformException, FactoryException {
 if (query.getHints().containsKey(SubsampleProcess.OUTPUT_BBOX)) {
  return ((ReferencedEnvelope) query.getHints().get(SubsampleProcess.OUTPUT_BBOX)).transform(
    reader.getFeatureType().getCoordinateReferenceSystem(),
    true);
 }
 return null;
}

代码示例来源:origin: org.geotools/gt-imagemosaic

if (hints != null && !hints.containsKey(JAI.KEY_BORDER_EXTENDER)) {
  final Object extender = hints.get(JAI.KEY_BORDER_EXTENDER);
  if (!(extender != null && extender instanceof BorderExtender)) {

代码示例来源:origin: org.geotools/gt-coverage

if (this.hints.containsKey(Hints.GRID_COVERAGE_FACTORY)) {
  final Object factory = this.hints.get(Hints.GRID_COVERAGE_FACTORY);
  if (factory != null && factory instanceof GridCoverageFactory) {

代码示例来源:origin: locationtech/geowave

if (this.query.getHints().containsKey(SubsampleProcess.SUBSAMPLE_ENABLED)
  && (Boolean) this.query.getHints().get(SubsampleProcess.SUBSAMPLE_ENABLED)) {
 spatialOnly = true;

代码示例来源:origin: locationtech/geowave

contraints.limit,
     (DistributedRenderOptions) query.getHints().get(DistributedRenderProcess.OPTIONS));
} else if (query.getHints().containsKey(SubsampleProcess.OUTPUT_WIDTH)
  && query.getHints().containsKey(SubsampleProcess.OUTPUT_HEIGHT)
  && query.getHints().containsKey(SubsampleProcess.OUTPUT_BBOX)) {
 double pixelSize = 1;
 if (query.getHints().containsKey(SubsampleProcess.PIXEL_SIZE)) {
  pixelSize = (Double) query.getHints().get(SubsampleProcess.PIXEL_SIZE);

代码示例来源:origin: org.geotools/gt-imagemosaic

throw new DataSourceException("Unable to create reader for this mosaic since we could not parse the configuration.");
if(this.hints.containsKey(Hints.MOSAIC_LOCATION_ATTRIBUTE))
  this.locationAttributeName=((String)this.hints.get(Hints.MOSAIC_LOCATION_ATTRIBUTE));

代码示例来源:origin: locationtech/geogig

if (query.getHints().containsKey(GeogigFeatureSource.WALK_INFO_KEY)) {
  WALK_INFO.set(builder.getBuiltWalkInfo());

代码示例来源:origin: org.geotools/gt-imagemosaic

if (request.getTileDimensions()!= null) {
  final Dimension tileDimension = request.getTileDimensions();
  if (hints != null && hints.containsKey(JAI.KEY_IMAGE_LAYOUT)){
    final Object layout = this.hints.get(JAI.KEY_IMAGE_LAYOUT);
    if (layout != null && layout instanceof ImageLayout){

代码示例来源:origin: org.geotools/gt-imagemosaic

final RenderingHints localHints = new RenderingHints(JAI.KEY_IMAGE_LAYOUT,layout);
if (hints != null && !hints.isEmpty()){
  if (hints.containsKey(JAI.KEY_TILE_CACHE)){
    final Object tc = hints.get(JAI.KEY_TILE_CACHE);
    if (tc != null && tc instanceof TileCache)
  if (hints != null && hints.containsKey(JAI.KEY_BORDER_EXTENDER)){
    final Object extender = hints.get(JAI.KEY_BORDER_EXTENDER);
    if (extender != null && extender instanceof BorderExtender) {
    localHints.add(ImageUtilities.BORDER_EXTENDER_HINTS);
  if (hints.containsKey(JAI.KEY_TILE_SCHEDULER)){
    final Object ts = hints.get(JAI.KEY_TILE_SCHEDULER);
    if (ts != null && ts instanceof TileScheduler)

代码示例来源:origin: locationtech/geogig

featureReader = FeatureReaderAdapter.of(diffType, diffFeatures);
if (query.getHints().containsKey(GeogigFeatureSource.WALK_INFO_KEY)) {
  GeogigFeatureSource.WALK_INFO.set(diffWalkInfo);

相关文章