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

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

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

Hints.add介绍

暂无

代码示例

代码示例来源: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

hints = new Hints();
hints.add(new RenderingHints(Hints.REPOSITORY, repository));
if (coverageExecutor != null) {
  hints.add(new RenderingHints(Hints.EXECUTOR_SERVICE, coverageExecutor));

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

/** */
private void setInterpolationHints() {
  if (interpolation instanceof InterpolationNearest) {
    this.hints.add(new RenderingHints(JAI.KEY_REPLACE_INDEX_COLOR_MODEL, Boolean.FALSE));
    this.hints.add(new RenderingHints(JAI.KEY_TRANSFORM_ON_COLORMAP, Boolean.TRUE));
  } else {
    this.hints.add(new RenderingHints(JAI.KEY_REPLACE_INDEX_COLOR_MODEL, Boolean.TRUE));
    this.hints.add(new RenderingHints(JAI.KEY_TRANSFORM_ON_COLORMAP, Boolean.FALSE));
  }
}

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

/**
 * Used to combine provided hints with global GeoTools defaults.
 *
 * @param hints
 * @return
 */
public static Hints addDefaultHints(final Hints hints) {
  final Hints completed = getDefaultHints();
  if (hints != null) {
    completed.add(hints);
  }
  return completed;
}

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

private void setupInterpolationHints(final Interpolation interpolation) {
  ////
  //
  // INTERPOLATION
  //
  ////
  if (interpolation != null) {
    if (LOGGER.isLoggable(Level.FINE)) {
      LOGGER.fine("Rendering using interpolation " + interpolation);
    }
    this.interpolation = interpolation;
    hints.add(new RenderingHints(JAI.KEY_INTERPOLATION, this.interpolation));
    if (LOGGER.isLoggable(Level.FINE)) {
      LOGGER.fine("Rendering using interpolation " + interpolation);
    }
    setInterpolationHints();
  }
}

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

public static Hints setupJAIHints(RenderingHints inputHints) {
  final Hints hints = new Hints();
  if (inputHints != null) {
    // TileCache
    TileCache tc = Utils.getTileCacheHint(inputHints);
    if (tc != null) {
      hints.add(new RenderingHints(JAI.KEY_TILE_CACHE, tc));
    }
    // TileScheduler
    TileScheduler tileScheduler = Utils.getTileSchedulerHint(inputHints);
    if (tileScheduler != null) {
      hints.add(new RenderingHints(JAI.KEY_TILE_SCHEDULER, tileScheduler));
    }
  }
  return hints;
}

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

/**
   * Returns new hints that combine user supplied hints with the {@linkplain
   * GeoTools#getDefaultHints defaults hints}. If a hint is specified in both user and default
   * hints, then user hints have precedence.
   *
   * <p>The returned hints should live only the time needed for invoking {@link FactoryRegistry}
   * methods. No long-term reference should be held.
   *
   * @param hints The user hints, or {@code null} if none.
   * @return New hints (never {@code null}).
   */
  public static Hints mergeSystemHints(final Hints hints) {
    if (hints instanceof StrictHints) {
      /*
       * The hints have already been merged in a previous call to this method and we don't
       * want to merge them again. This case happen typically in factory constructor fetching
       * for dependencies. The constructor may have removed some hints. For example the
       * "URN:OGC" factory may looks for the "EPSG" factory with FORCE_LONGITUDE_FIRST
       * forced to FALSE.
       */
      return hints;
    }
    final Hints merged = Hints.getDefaults(true);
    if (hints != null) {
      merged.add(hints);
    }
    return merged;
  }
}

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

private void setReader(Hints hints, final boolean updateHints) {
  ImageMosaicReader reader = getImageMosaicReader(hints);
  if (reader != null && updateHints) {
    Hints readerHints = reader.getHints();
    readerHints.add(hints);
  }
}

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

if (hints != null) {
  this.hints.add(hints);

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

boolean update = false;
if (auxiliaryFilePath != null) {
  hints.add(new RenderingHints(Utils.AUXILIARY_FILES_PATH, auxiliaryFilePath));
  update = true;
  hints.add(
      new RenderingHints(Utils.AUXILIARY_DATASTORE_PATH, auxiliaryDatastorePath));
  update = true;
  hints.add(new RenderingHints(Utils.PARENT_DIR, parentDir));

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

private void setupTilingHints(final int tileSizeX, final int tileSizeY) {
  ////
  //
  // TILING
  //
  ////
  if (tileSizeX > 0 && tileSizeY > 0) {
    // Tile Size
    final ImageLayout layout = new ImageLayout2();
    layout.setTileGridXOffset(0)
        .setTileGridYOffset(0)
        .setTileHeight(tileSizeY)
        .setTileWidth(tileSizeX);
    hints.add(new RenderingHints(JAI.KEY_IMAGE_LAYOUT, layout));
  }
}

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

this.hints.add(hints);
this.hints.add(new Hints(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE));

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

/**
 * Constructs a default coverage processor. The {@link #scanForPlugins} method will be
 * automatically invoked the first time an operation is required. Additional operations can be
 * added by subclasses with the {@link #addOperation} method. Rendering hints will be
 * initialized with the following hints:
 *
 * <p>
 *
 * <ul>
 *   <li>{@link JAI#KEY_REPLACE_INDEX_COLOR_MODEL} set to {@link Boolean#FALSE}.
 *   <li>{@link JAI#KEY_TRANSFORM_ON_COLORMAP} set to {@link Boolean#FALSE}.
 * </ul>
 *
 * @param hints A set of additional rendering hints, or {@code null} if none.
 */
public CoverageProcessor(final RenderingHints hints) {
  registry = new FactoryRegistry(Arrays.asList(new Class<?>[] {Operation.class}));
  this.hints = new Hints();
  this.hints.put(JAI.KEY_REPLACE_INDEX_COLOR_MODEL, Boolean.FALSE);
  this.hints.put(JAI.KEY_TRANSFORM_ON_COLORMAP, Boolean.FALSE);
  // override with user hints
  if (hints != null) this.hints.add(hints);
}

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

this.hints = new Hints(Hints.LENIENT_DATUM_SHIFT, Boolean.TRUE);
this.hints.add(hints);

代码示例来源: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;
}

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

/**
 * Creates an instance from the specified hints. This method recognizes the {@link
 * Hints#CRS_FACTORY CRS}, {@link Hints#CS_FACTORY CS}, {@link Hints#DATUM_FACTORY DATUM} and
 * {@link Hints#MATH_TRANSFORM_FACTORY MATH_TRANSFORM} {@code FACTORY} hints.
 *
 * @param hints The hints, or {@code null} if none.
 * @return A factory group created from the specified set of hints.
 */
public static ReferencingFactoryContainer instance(final Hints hints) {
  final Hints completed = GeoTools.getDefaultHints();
  if (hints != null) {
    completed.add(hints);
  }
  /*
   * Use the same synchronization lock than ReferencingFactoryFinder (instead of this class)
   * in order to reduce the risk of dead lock. This is because ReferencingFactoryContainer
   * creation may queries ReferencingFactoryFinder, and some implementations managed by
   * ReferencingFactoryFinder may ask for a ReferencingFactoryContainer in turn.
   */
  synchronized (ReferencingFactoryFinder.class) {
    if (cache == null) {
      cache =
          new FactoryCreator(
              Arrays.asList(new Class<?>[] {ReferencingFactoryContainer.class}));
      cache.registerFactory(
          new ReferencingFactoryContainer(null), ReferencingFactoryContainer.class);
    }
    return cache.getFactory(ReferencingFactoryContainer.class, null, completed, null);
  }
}

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

localHints.add(new Hints(Utils.MOSAIC_READER, this));

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

this.hints.add(newHints);
  interpolation = (Interpolation) newHints.get(JAI.KEY_INTERPOLATION);
} else {
  hints.add(new RenderingHints(JAI.KEY_INTERPOLATION, interpolation));
this.hints.add(
    new RenderingHints(
        JAI.KEY_BORDER_EXTENDER,

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

/**
 * Set the main parameters of this coverage request, getting basic information from the reader.
 *
 * @param reader a {@link BaseGridCoverage2DReader} from where to get basic coverage properties
 *     as well as basic parameters to be used by the incoming read operations.
 */
private void setBaseParameters(final BaseGridCoverage2DReader reader) {
  input = reader.getInputFile();
  this.coverageEnvelope = reader.getOriginalEnvelope().clone();
  this.coverageRasterArea = ((GridEnvelope2D) reader.getOriginalGridRange());
  this.coverageCRS = reader.getCoordinateReferenceSystem();
  this.coverageName = reader.getCoverageName();
  this.coverageGridToWorld2D = (MathTransform2D) reader.getRaster2Model();
  this.coverageFullResolution = reader.getHighestRes();
  this.hints = reader.getHints().clone();
  this.multiLevelRoi = reader.getMultiLevelRoi();
  if (layout != null) {
    this.hints.add(new RenderingHints(JAI.KEY_IMAGE_LAYOUT, layout));
  }
}

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

final ImageLayout layout = new ImageLayout();
layout.setTileWidth(tileDimension.width).setTileHeight(tileDimension.height);
this.hints.add(new RenderingHints(JAI.KEY_IMAGE_LAYOUT, layout));

相关文章