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

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

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

Hints.add介绍

暂无

代码示例

代码示例来源:origin: org.geotools/gt2-main

private static Hints addDefaultHints(final Hints hints) {
  final Hints completed = GeoTools.getDefaultHints();
  if (hints != null) {
    completed.add(hints);
  }
  return completed;
}

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

/**
 * 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: org.geotools/gt-metadata

/**
   * 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: org.geotools/gt2-metadata

/**
   * 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: org.geotools/gt2-metadata

/**
 * Adds all specified hints to the system hints. This
 * is for {@link GeoTools#init} implementation only.
 */
static void putSystemDefault(final RenderingHints hints) {
  synchronized (GLOBAL) {
    ensureSystemDefaultLoaded();
    GLOBAL.add(hints);
  }
  GeoTools.fireConfigurationChanged();
}

代码示例来源:origin: org.geoserver.community/importer-core

public GeoToolsCoverageTransformer(String defaultSRS) {
  // create basic hints
  hints = new Hints(GeoTools.getDefaultHints());
  if (defaultSRS != null) {
    try {
      final CoordinateReferenceSystem crs = CRS.decode(defaultSRS);
      hints.add(new RenderingHints(Hints.DEFAULT_COORDINATE_REFERENCE_SYSTEM, crs));
    } catch (Exception e) {
      LOGGER.log(Level.FINE, "Cannot parse CRS " + defaultSRS, new Exception());
      hints = new Hints(GeoTools.getDefaultHints());
    }
  }
}

代码示例来源:origin: org.geotools/gt2-image

if (this.hints == null) {
  this.hints = new Hints(Hints.LENIENT_DATUM_SHIFT, Boolean.TRUE);
  this.hints.add(new RenderingHints(JAI.KEY_TILE_CACHE, null));
this.hints.add(hints);

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

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

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

/**
 * Adds all specified hints to the system hints. This
 * is for {@link GeoTools#init} implementation only.
 */
static void putSystemDefault(final RenderingHints hints) {
  synchronized (GLOBAL) {
    ensureSystemDefaultLoaded();
    GLOBAL.add(hints);
  }
  GeoTools.fireConfigurationChanged();
}

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

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

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

/**
 * 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>
 *   <li>{@link JAI#KEY_TRANSFORM_ON_COLORMAP} set to {@link Boolean#FALSE}.</li>
 * </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: org.geotools/gt-coverage

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

代码示例来源:origin: org.geotools/gt-imageio-ext-gdal

/**
 * 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.getCrs();
  this.coverageName = reader.getCoverageName();
  this.coverageGridToWorld2D = (MathTransform2D) reader.getRaster2Model();
  this.coverageFullResolution = reader.getHighestRes();
  this.hints = reader.getHints().clone();
  if (layout != null) {
    this.hints.add(new RenderingHints(JAI.KEY_IMAGE_LAYOUT, layout));
  }
}

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

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

代码示例来源:origin: org.locationtech.geogig/geogig-geotools

private void insert(final WorkingTree workTree, final String treePath,
    @SuppressWarnings("rawtypes") final FeatureSource featureSource,
    final ProgressListener taskProgress) {
  final Query query = new Query();
  CoordinateSequenceFactory coordSeq = new PackedCoordinateSequenceFactory();
  query.getHints().add(new Hints(Hints.JTS_COORDINATE_SEQUENCE_FACTORY, coordSeq));
  try (FeatureIterator fit = featureSource.getFeatures(query).features()) {
    FeatureType schema = featureSource.getSchema();
    RevFeatureType featureType = RevFeatureTypeBuilder.build(schema);
    objectDatabase().put(featureType);
    ObjectId featureTypeId = featureType.getId();
    if (fit.hasNext()) {
      Iterator<Feature> features = new FeatureIteratorIterator<>(fit);
      insert(workTree, treePath, features, taskProgress, featureTypeId);
    }
  } catch (IOException e) {
    LOG.warn("Unable to insert into " + treePath, e);
    throw new GeoToolsOpException(e, StatusCode.UNABLE_TO_INSERT);
  }
}

代码示例来源:origin: org.geoserver.community.backuprestore/gs-backup-restore-core

@Test
public void testParameterizePasswordsInBackup() throws Exception {
  Hints hints = new Hints(new HashMap(2));
  hints.add(
      new Hints(
          new Hints.OptionKey(Backup.PARAM_BEST_EFFORT_MODE),
          Backup.PARAM_BEST_EFFORT_MODE));
  hints.add(
      new Hints(
          new Hints.OptionKey(Backup.PARAM_PARAMETERIZE_PASSWDS),

代码示例来源:origin: org.geoserver.community.backuprestore/gs-backup-restore-core

@Test
public void testTryToRunMultipleSpringBatchBackupJobs() throws Exception {
  Hints hints = new Hints(new HashMap(2));
  hints.add(
      new Hints(
          new Hints.OptionKey(Backup.PARAM_BEST_EFFORT_MODE),

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

private void insert(final WorkingTree workTree, final String treePath,
    @SuppressWarnings("rawtypes") final FeatureSource featureSource,
    final ProgressListener taskProgress) {
  final Query query = new Query();
  query.setFilter(filter);
  CoordinateSequenceFactory coordSeq = new PackedCoordinateSequenceFactory();
  query.getHints().add(new Hints(Hints.JTS_COORDINATE_SEQUENCE_FACTORY, coordSeq));
  try (FeatureIterator fit = featureSource.getFeatures(query).features()) {
    FeatureType schema = featureSource.getSchema();
    RevFeatureType featureType = RevFeatureType.builder().type(schema).build();
    objectDatabase().put(featureType);
    ObjectId featureTypeId = featureType.getId();
    if (fit.hasNext()) {
      Iterator<Feature> features = new FeatureIteratorIterator<>(fit);
      insert(workTree, treePath, features, taskProgress, featureTypeId);
    }
  } catch (IOException e) {
    LOG.warn("Unable to insert into " + treePath, e);
    throw new GeoToolsOpException(e, StatusCode.UNABLE_TO_INSERT);
  }
}

代码示例来源:origin: org.geoserver.community.backuprestore/gs-backup-restore-core

@Test
public void testRunSpringBatchBackupJob() throws Exception {
  Hints hints = new Hints(new HashMap(2));
  hints.add(
      new Hints(
          new Hints.OptionKey(Backup.PARAM_BEST_EFFORT_MODE),

代码示例来源:origin: org.geoserver.community.backuprestore/gs-backup-restore-core

@Test
public void testRunSpringBatchFilteredRestoreJob() throws Exception {
  Hints hints = new Hints(new HashMap(2));
  hints.add(
      new Hints(
          new Hints.OptionKey(Backup.PARAM_BEST_EFFORT_MODE),

相关文章