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

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

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

Hints.<init>介绍

[英]Constructs an initially empty set of hints.
[中]构造一组初始为空的提示。

代码示例

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

public int removeGranules(Filter filter) {
  return removeGranules(filter, new Hints());
}

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

/**
 * Returns the reader hints based on the current WCS configuration
 *
 * @param wcs
 */
public static Hints getReaderHints(WCSInfo wcs) {
  Hints hints = new Hints();
  hints.add(new Hints(Hints.LENIENT_DATUM_SHIFT, Boolean.TRUE));
  if (wcs.getOverviewPolicy() == null) {
    hints.add(new Hints(Hints.OVERVIEW_POLICY, OverviewPolicy.IGNORE));
  } else {
    hints.add(new Hints(Hints.OVERVIEW_POLICY, wcs.getOverviewPolicy()));
  }
  hints.put(
      Hints.DECIMATION_POLICY,
      wcs.isSubsamplingEnabled() ? DecimationPolicy.ALLOW : DecimationPolicy.DISALLOW);
  return hints;
}

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

public GridCoverageReader getGridCoverageReader(ProgressListener listener, Hints hints)
    throws IOException {
  // manage projection policy
  if (this.projectionPolicy == ProjectionPolicy.FORCE_DECLARED) {
    final Hints crsHints =
        new Hints(Hints.DEFAULT_COORDINATE_REFERENCE_SYSTEM, this.getCRS());
    if (hints != null) hints.putAll(crsHints);
    else hints = crsHints;
  }
  return catalog.getResourcePool().getGridCoverageReader(this, nativeCoverageName, hints);
}

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

public GridCoverage getGridCoverage(
    ProgressListener listener, ReferencedEnvelope envelope, Hints hints)
    throws IOException {
  // manage projection policy
  if (this.projectionPolicy == ProjectionPolicy.FORCE_DECLARED) {
    final Hints crsHints =
        new Hints(Hints.DEFAULT_COORDINATE_REFERENCE_SYSTEM, this.getCRS());
    if (hints != null) hints.putAll(crsHints);
    else hints = crsHints;
  }
  return catalog.getResourcePool().getGridCoverage(this, envelope, hints);
}

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

public GridCoverage getGridCoverage(ProgressListener listener, Hints hints) throws IOException {
  // manage projection policy
  if (this.projectionPolicy == ProjectionPolicy.FORCE_DECLARED) {
    final Hints crsHints =
        new Hints(Hints.DEFAULT_COORDINATE_REFERENCE_SYSTEM, this.getCRS());
    if (hints != null) hints.putAll(crsHints);
    else hints = crsHints;
  }
  return catalog.getResourcePool().getGridCoverage(this, null, hints);
}

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

hints = new Hints(hints);
} else {
  hints = new Hints();

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

Hints localHints = new Hints(hints);
  if (dynamicAlphaSource != null
      && mergedBands.size() == 1
if (coverages.size() > 1) {
  Hints localHints = new Hints(hints);
  if (dynamicAlphaSource != null) {
    int currentBandCount = countBands(coverages);

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

/**
 * Get hints that have been set to control the query execution.
 *
 * @return hints that are set (may be empty)
 * @see #setHints(Hints) setHints(Hints) for more explanation
 */
public Hints getHints() {
  if (hints == null) {
    hints = new Hints();
  }
  return hints;
}

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

/**
 * Creates a new instance of GeoTiffReader
 *
 * @param input the GeoTiff file
 * @throws DataSourceException
 */
public GeoTiffReader(Object input) throws DataSourceException {
  this(input, new Hints(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE));
}

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

/** Returns a default common factory instance. */
public static synchronized BasicFactories getDefault() {
  if (DEFAULT == null) {
    DEFAULT = new BasicFactories(new Hints(Hints.LENIENT_DATUM_SHIFT, Boolean.TRUE));
  }
  return DEFAULT;
}

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

GridCoverageReader returnedReader2 =
    pool.getGridCoverageReader(
        storeInfo, new Hints(Hints.KEY_ANTIALIASING, Hints.VALUE_ANTIALIAS_ON));
assertThat(reader, equalTo(returnedReader2));
final Hints hints2 = capturedHints.getValue();

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

query.setMaxFeatures(maxEntries);
query.setPropertyNames(new String[] {descriptor.getStartAttribute()});
query.setHints(new Hints(StructuredCoverageViewReader.QUERY_FIRST_BAND, true));

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

/**
 * Returns the hints to be used for lazy creation of <em>default</em> factories in various
 * {@code getFoo} methods. This is different from {@link #getImplementationHints} because the
 * later may returns non-default factories.
 */
private Hints hints() {
  final Hints completed = new Hints(hints);
  setHintsInto(completed);
  return completed;
}

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

/** Returns a factory of the given type. */
private static final <T extends AbstractAuthorityFactory> T getFactory(final Class<T> type) {
  return type.cast(
      ReferencingFactoryFinder.getCRSAuthorityFactory(
          "EPSG", new Hints(Hints.CRS_AUTHORITY_FACTORY, type)));
}

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

Number safeConvertToNumber(Expression expression, Class target) {
  return (Number)
      Converters.convert(
          expression.evaluate(null),
          target,
          new Hints(ConverterFactory.SAFE_CONVERSION, true));
}

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

/**
 * Returns a factory from the specified hints. Used by {@link URN_AuthorityFactory} constructor
 * as well.
 */
static AllAuthoritiesFactory getFactory(Hints hints, final String authority) {
  if (!defaultAxisOrderHints(hints, authority)) {
    hints = new Hints(hints);
    hints.put(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.FALSE);
  }
  return new AllAuthoritiesFactory(hints);
}

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

/** Returns the {@linkplain #hints hints} extented will all hints specified in dependencies. */
private Hints hints() {
  final Hints extended = new Hints(hints);
  addAll(operationFactory, extended);
  addAll(datumFactory, extended);
  addAll(csFactory, extended);
  addAll(crsFactory, extended);
  extended.putAll(hints); // Gives precedence to the hints from this class.
  return extended;
}

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

/** Gets the authority factory for ESRI. */
@Before
public void setUp() {
  factory =
      (FactoryUsingWKT)
          ReferencingFactoryFinder.getCRSAuthorityFactory(
              "EPSG",
              new Hints(Hints.CRS_AUTHORITY_FACTORY, FactoryUsingWKT.class));
}

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

public void testGetValidatingFeatureFactory() {
    Hints hints = new Hints(Hints.FEATURE_FACTORY, ValidatingFeatureFactoryImpl.class);
    FeatureFactory featureFactory = CommonFactoryFinder.getFeatureFactory(hints);
    assertNotNull(featureFactory);
    assertTrue(featureFactory instanceof ValidatingFeatureFactoryImpl);
  }
}

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

public void testMixQueryAll() {
  // mixing Query.ALL equivalents with extra hints did not work
  Query firstQuery = new Query(Query.ALL);
  Query secondQuery = new Query(Query.ALL);
  firstQuery.setHints(new Hints(Hints.USE_PROVIDED_FID, Boolean.TRUE));
  secondQuery.setHints(new Hints(Hints.FEATURE_2D, Boolean.TRUE));
  Query mixed = DataUtilities.mixQueries(firstQuery, secondQuery, "mixer");
  assertEquals(2, mixed.getHints().size());
  assertTrue((Boolean) mixed.getHints().get(Hints.USE_PROVIDED_FID));
  assertTrue((Boolean) mixed.getHints().get(Hints.FEATURE_2D));
}

相关文章