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

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

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

Hints.<init>介绍

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

代码示例

代码示例来源:origin: opentripplanner/OpenTripPlanner

@Override
public GridCoverage2D getGridCoverage() {
  try {
    // There is a serious standardization failure around the axis order of WGS84. See issue #1930.
    // GeoTools assumes strict EPSG axis order of (latitude, longitude) unless told otherwise.
    // Both NED and SRTM data use the longitude-first axis order, so OTP makes grid coverages
    // for unprojected DEMs assuming coordinates are in (longitude, latitude) order.
    Hints forceLongLat = new Hints(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE);
    GeoTiffFormat format = new GeoTiffFormat();
    GeoTiffReader reader = format.getReader(path, forceLongLat);
    coverage = reader.read(null);
    LOG.info("Elevation model CRS is: {}", coverage.getCoordinateReferenceSystem2D());
  } catch (IOException e) {
    throw new RuntimeException("Error getting coverage automatically. ", e);
  }
  return coverage;
}

代码示例来源:origin: opentripplanner/OpenTripPlanner

CoordinateReferenceSystem sourceCRS = featureSource.getInfo().getCRS();
Hints hints = new Hints(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE);
CRSAuthorityFactory factory = ReferencingFactoryFinder.getCRSAuthorityFactory("EPSG",
    hints);

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

/**
 * Creates a new instance of {@code BasicFactories} with the specified set of hints. The
 * {@code hints} map should contains only the minimum set of hints, since this constructor
 * will keep a reference to all objects found in this map.
 * 
 * @param hints The hints to be used for all factory creation, or {@code null} if none.
 */
public BasicFactories(final Map hints) {
  this.hints = (hints!=null) ? new Hints(hints) : null;
}

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

/**
 * Creates a new instance of {@code BasicFactories} with the specified set of hints. The
 * {@code hints} map should contains only the minimum set of hints, since this constructor
 * will keep a reference to all objects found in this map.
 * 
 * @param hints The hints to be used for all factory creation, or {@code null} if none.
 */
public BasicFactories(final Map hints) {
  this.hints = (hints!=null) ? new Hints(hints) : null;
}

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

public Hints getHints() {
  if(hints == null)
    hints = new Hints(Collections.EMPTY_MAP);
  return hints;
}

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

/**
 * Getter for  {@link Hints}  .
 * @return   {@link Hints}  provided at construction time to control {@link GridCoverageFactory}  creation.
 * @uml.property  name="hints"
 */
public synchronized Hints getHints() {
  return new Hints(hints);
}

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

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

/**
   * Returns an empty Hints set
   */
  public Hints getHints() {
    return new Hints(Collections.EMPTY_MAP);
  }
}

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

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

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

/**
 * 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: locationtech/geowave

public GeoWaveRasterReader(final GeoWaveRasterConfig config) throws DataSourceException {
 super(new Object(), new Hints());
 this.config = config;
 init(config);
}

代码示例来源:origin: org.n52.sensorweb/timeseries-io

/**
 * Creates a {@link CRSUtils} which offers assistance when doing spatial opererations. Forcing XY means
 * that CRS axis ordering is considered lon/lat ordering, even if defined lat/lon.
 *
 * @return creates a reference helper which (strictly) handles referencing operations.
 * @throws IllegalStateException
 *         if decoding default CRS fails.
 */
public static CRSUtils createEpsgForcedXYAxisOrder() {
  Hints hints = new Hints(FORCE_LONGITUDE_FIRST_AXIS_ORDER, TRUE);
  return createEpsgReferenceHelper(hints);
}

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

public Coverage doOperation(ParameterValueGroup parameters, Hints hints) {
    return FilteredSubsampledGridCoverage2D
    .create(parameters,
        (hints instanceof Hints) ? (Hints) hints
            : new Hints(hints));
  }
}

代码示例来源:origin: stackoverflow.com

try {
   Hints hints = new Hints();
   hints.getList();        // adds to the stack
   Stack s = hints.getStack();  // return the stack
   int stackSize = s.size();
   for (int i = 0; i < stackSize; i++) {
     System.out.println(s.pop());        // pop from the stack
   }
 } catch (IOException ex) {
   Logger.getLogger(JavaApplication18.class.getName()).log(Level.SEVERE, null, ex);
 }

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

/**
 * Creates a new instance using the specified hints.
 *
 * @param hints The hints, or {@code null} if none.
 */
public Operations(final RenderingHints hints) {
  if (hints != null && !hints.isEmpty()) {
    processor = CoverageProcessor.getInstance(new Hints(hints));
  }
  // Otherwise, will creates the processor only when first needed.
}

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

public Coverage doOperation(ParameterValueGroup parameters, Hints hints) {
    try {
      return ScaledGridCoverage2D
          .create(parameters,
              (hints instanceof Hints) ? (Hints) hints
                  : new Hints(hints));
    } catch (NoninvertibleTransformException e) {
      throw new CannotScaleException(Errors
          .format(ErrorKeys.NONINVERTIBLE_SCALING_TRANSFORM), e);
    }
  }
}

代码示例来源:origin: 52North/SOS

@Override
public void init() {
  GeometryHandler.instance = this;
  Hints hints = new Hints(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER,
              isEastingFirstEpsgCode(getStorageEPSG()));
  this.crsAuthority = getCRSAuthorityFactory(this.authority, hints);
}

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

@Override
  protected FeatureCollection getMatches(Filter filter) throws IOException {
    GranuleSource granules = reader.getGranules(null, true);
    Query q = new Query(null, filter);
    q.setHints(new Hints(StructuredCoverageViewReader.QUERY_FIRST_BAND, true));
    return granules.getGranules(q);
  }
}

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

@BeforeClass
public static void setup() throws NoSuchAuthorityCodeException, FactoryException {
  Hints hints = new Hints(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE);
  CRSAuthorityFactory factory = ReferencingFactoryFinder.getCRSAuthorityFactory("EPSG",
      hints);
  PROJ_EPSG4326_CRS = (AbstractReferenceSystem) factory
      .createCoordinateReferenceSystem(PROJ_EPSG4326);
  PROJ_EQUIV_EPSG4326_CRS = (AbstractReferenceSystem) CRS.parseWKT(PROJ_EQUIV_EPSG4326);
}

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

@BeforeClass
public static void setup() throws NoSuchAuthorityCodeException, FactoryException {
  Hints hints = new Hints(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE);
  CRSAuthorityFactory factory = ReferencingFactoryFinder.getCRSAuthorityFactory("EPSG",
      hints);
  PROJ_EPSG4326_CRS = (AbstractReferenceSystem) factory
      .createCoordinateReferenceSystem(PROJ_EPSG4326);
  PROJ_EQUIV_EPSG4326_CRS = (AbstractReferenceSystem) CRS.parseWKT(PROJ_EQUIV_EPSG4326);
}

相关文章