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

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

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

Hints.containsKey介绍

暂无

代码示例

代码示例来源:origin: geoserver/geoserver

if (defHints != null && defHints.containsKey(Hints.EXECUTOR_SERVICE)) {
  executor = (ThreadPoolExecutor) defHints.get(Hints.EXECUTOR_SERVICE);

代码示例来源:origin: geoserver/geoserver

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

代码示例来源:origin: geoserver/geoserver

if (hints != null && hints.containsKey(JOINS)) {
  List<Join> joins = (List<Join>) hints.get(JOINS);
  SimpleFeatureTypeBuilder typeBuilder = new SimpleFeatureTypeBuilder();

代码示例来源:origin: geotools/geotools

private void updateLocalHints(Hints hints, RenderingHints localHints) {
  if (hints != null && hints.containsKey(JAI.KEY_TILE_CACHE)) {
    final Object cache = hints.get(JAI.KEY_TILE_CACHE);
    if (cache != null && cache instanceof TileCache)
      localHints.add(new RenderingHints(JAI.KEY_TILE_CACHE, (TileCache) cache));
  }
  if (hints != null && hints.containsKey(JAI.KEY_TILE_SCHEDULER)) {
    final Object scheduler = hints.get(JAI.KEY_TILE_SCHEDULER);
    if (scheduler != null && scheduler instanceof TileScheduler)
      localHints.add(
          new RenderingHints(JAI.KEY_TILE_SCHEDULER, (TileScheduler) scheduler));
  }
}

代码示例来源:origin: geotools/geotools

public AggregateFactory getAggregateFactory() {
  if (aggregateFactory == null) {
    if (hints.containsKey(Hints.AGGREGATE_FACTORY)) {
      // check the hints for something explicit
      Object factory = hints.get(Hints.AGGREGATE_FACTORY);
      if (factory instanceof AggregateFactory) {
        aggregateFactory = (AggregateFactory) factory;
        return aggregateFactory;
      }
    }
    aggregateFactory = GeometryFactoryFinder.getAggregateFactory(hints);
  }
  return aggregateFactory;
}

代码示例来源:origin: geotools/geotools

public GeometryFactory getGeometryFactory() {
  if (geometryFactory == null) {
    if (hints.containsKey(Hints.GEOMETRY_FACTORY)) {
      // check the hints for something explicit
      Object factory = hints.get(Hints.GEOMETRY_FACTORY);
      if (factory instanceof GeometryFactory) {
        geometryFactory = (GeometryFactory) factory;
        return geometryFactory;
      }
    }
    geometryFactory = GeometryFactoryFinder.getGeometryFactory(hints);
  }
  return geometryFactory;
}

代码示例来源:origin: geotools/geotools

private void updateReaderWithAuxiliaryPath(
    Hints hints, ImageReader reader, Key key, String method)
    throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
  String filePath = (String) hints.get(key);
  if (filePath != null && hints.containsKey(Utils.PARENT_DIR)) {
    String parentDir = (String) hints.get(Utils.PARENT_DIR);
    // check if the file is not already absolute (old configuration file)
    if (!new File(filePath).isAbsolute()) {
      filePath = parentDir + File.separatorChar + filePath;
    }
  }
  if (filePath != null) {
    MethodUtils.invokeMethod(reader, method, filePath);
  }
}

代码示例来源:origin: geotools/geotools

/**
 * 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: geotools/geotools

public ComplexFactory getComplexFactory() {
  if (complexFactory == null) {
    if (hints.containsKey(Hints.COMPLEX_FACTORY)) {
      // check the hints for something explicit
      Object factory = hints.get(Hints.COMPLEX_FACTORY);
      if (factory instanceof ComplexFactory) {
        complexFactory = (ComplexFactory) factory;
        return complexFactory;
      }
    }
    complexFactory = GeometryFactoryFinder.getComplexFactory(hints);
  }
  return complexFactory;
}

代码示例来源:origin: geotools/geotools

public PositionFactory getPositionFactory() {
  if (positionFactory == null) {
    if (hints.containsKey(Hints.POSITION_FACTORY)) {
      // check the hints for something explicit
      Object factory = hints.get(Hints.POSITION_FACTORY);
      if (factory instanceof PositionFactory) {
        positionFactory = (PositionFactory) factory;
        return positionFactory;
      }
    }
    positionFactory = GeometryFactoryFinder.getPositionFactory(hints);
  }
  return positionFactory;
}

代码示例来源:origin: geotools/geotools

public PrimitiveFactory getPrimitiveFactory() {
  if (primitiveFactory == null) {
    if (hints.containsKey(Hints.PRIMITIVE_FACTORY)) {
      // check the hints for something explicit
      Object factory = hints.get(Hints.PRIMITIVE_FACTORY);
      if (factory instanceof PrimitiveFactory) {
        primitiveFactory = (PrimitiveFactory) factory;
        return primitiveFactory;
      }
    }
    primitiveFactory = GeometryFactoryFinder.getPrimitiveFactory(hints);
  }
  return primitiveFactory;
}

代码示例来源:origin: geotools/geotools

/**
 * 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: geotools/geotools

/**
 * Returns {@code true} if the image colormodel must be expanded for the operation.
 *
 * @param image The image to reproject.
 * @param hints The {@link Hints} used during the reprojection.
 */
private static boolean isColorModelExpanded(final RenderedImage image, final Hints hints) {
  if (image.getColorModel() instanceof IndexColorModel) {
    if (hints != null && hints.containsKey(JAI.KEY_REPLACE_INDEX_COLOR_MODEL)) {
      Boolean replace = (Boolean) hints.get(JAI.KEY_REPLACE_INDEX_COLOR_MODEL);
      if (replace != null) {
        return replace;
      }
    }
  }
  return false;
}

代码示例来源:origin: geotools/geotools

/**
 * 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: geotools/geotools

/**
 * 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: geotools/geotools

/**
 * 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: geotools/geotools

private ImageMosaicReader getImageMosaicReader(Hints hints) {
  ImageMosaicReader imReader = null;
  if (hints != null && hints.containsKey(Utils.MOSAIC_READER)) {
    Object reader = hints.get(Utils.MOSAIC_READER);
    if (reader instanceof ImageMosaicReader) {
      if (getParentReader() == null) {
        setParentReader((ImageMosaicReader) reader);
      }
      imReader = (ImageMosaicReader) reader;
    }
  }
  return imReader;
}

代码示例来源:origin: geotools/geotools

@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(" + getForce2DFunction() + "(");
      encodeColumnName(prefix, gatt.getLocalName(), sql);
      sql.append(")),'base64')");
    } else {
      sql.append("encode(ST_AsEWKB(");
      encodeColumnName(prefix, gatt.getLocalName(), sql);
      sql.append("),'base64')");
    }
  }
}

代码示例来源:origin: geotools/geotools

/**
 * Merges the wrapper hints with the query ones, making sure not to overwrite the query ones
 *
 * @param q
 * @return
 */
protected Query mergeHints(Query q) {
  if (this.hints == null || this.hints.isEmpty()) {
    return q;
  }
  Query clone = new Query(q);
  Hints hints = clone.getHints();
  if (hints == null || hints.isEmpty()) {
    clone.setHints(this.hints);
  } else {
    for (Entry<Object, Object> entry : this.hints.entrySet()) {
      if (!hints.containsKey(entry.getKey())) {
        hints.put(entry.getKey(), entry.getValue());
      }
    }
  }
  return clone;
}

代码示例来源:origin: geotools/geotools

private Hints updateRepositoryHints(CatalogBuilderConfiguration configuration, Hints hints) {
  ImageMosaicReader reader = getImageMosaicReader(hints);
  if (reader != null) {
    Hints readerHints = reader.getHints();
    if (readerHints != null && readerHints.containsKey(Hints.REPOSITORY)) {
      hints.add(new Hints(Hints.REPOSITORY, readerHints.get(Hints.REPOSITORY)));
    }
  }
  return hints;
}

相关文章