org.geotools.referencing.CRS.getEllipsoid()方法的使用及代码示例

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

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

CRS.getEllipsoid介绍

[英]Returns the first ellipsoid found in a coordinate reference system, or null if there is none.
[中]返回在坐标参照系中找到的第一个椭球体,如果没有,则返回null。

代码示例

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

/**
 * Constructs a new geodetic calculator expecting coordinates in the supplied CRS. The ellipsoid
 * will be inferred from the CRS.
 *
 * @param crs The reference system for the {@link Position} objects.
 * @since 2.2
 */
public GeodeticCalculator(final CoordinateReferenceSystem crs) {
  this(CRS.getEllipsoid(crs), crs);
}

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

/**
 * Returns the first ellipsoid found in a coordinate reference system, or {@code null} if there
 * is none.
 *
 * @param crs The coordinate reference system, or {@code null}.
 * @return The ellipsoid, or {@code null} if none.
 * @since 2.4
 */
public static Ellipsoid getEllipsoid(final CoordinateReferenceSystem crs) {
  final Datum datum = CRSUtilities.getDatum(crs);
  if (datum instanceof GeodeticDatum) {
    return ((GeodeticDatum) datum).getEllipsoid();
  }
  if (crs instanceof CompoundCRS) {
    final CompoundCRS cp = (CompoundCRS) crs;
    for (final CoordinateReferenceSystem c : cp.getCoordinateReferenceSystems()) {
      final Ellipsoid candidate = getEllipsoid(c);
      if (candidate != null) {
        return candidate;
      }
    }
  }
  return null;
}

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

public Object getValue(final GridCoverage coverage) {
    return CRS.getEllipsoid(coverage.getCoordinateReferenceSystem());
  }
};

代码示例来源:origin: bcdev/beam

private ObservationIterator(Product product, SamplePointer pointer, BinningContext binningContext) {
  this.pointer = pointer;
  this.dataPeriod = binningContext.getDataPeriod();
  Geometry geometryRegion = binningContext.getRegion();
  if (geometryRegion != null) {
    this.region = PreparedGeometryFactory.prepare(binningContext.getRegion());
  } else {
    this.region = null;
  }
  this.product = product;
  this.productHasTime = product.getStartTime() != null || product.getEndTime() != null;
  this.gc = product.getGeoCoding();
  Ellipsoid ellipsoid = CRS.getEllipsoid(gc.getMapCRS());
  earthRadius = ellipsoid != null ? ellipsoid.getSemiMajorAxis() : DefaultEllipsoid.WGS84.getSemiMajorAxis();
  geometryFactory = new GeometryFactory();
  maxDistanceOnEarth = binningContext.getMaxDistanceOnEarth();
}

代码示例来源:origin: bcdev/beam

this.imageToMap = imageToMap;
setMapCRS(mapCRS);
org.opengis.referencing.datum.Ellipsoid gtEllipsoid = CRS.getEllipsoid(mapCRS);
String ellipsoidName = gtEllipsoid.getName().getCode();
Ellipsoid ellipsoid = new Ellipsoid(ellipsoidName,

相关文章