org.geotools.geometry.jts.JTS.bounds()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(265)

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

JTS.bounds介绍

[英]Replacement for geometry.getEnvelopeInternal() that returns ReferencedEnvelope or ReferencedEnvelope3D as appropriate for the provided CRS.
[中]替换几何体。getEnvelopeInternal(),根据所提供的CRS的情况返回ReferencedEnvelope或ReferencedEnvelope3D。

代码示例

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

public BoundingBox getBounds() {
  // TODO: cache this value
  CoordinateReferenceSystem crs = featureType.getCoordinateReferenceSystem();
  Envelope bounds = ReferencedEnvelope.create(crs);
  for (Object o : values) {
    if (o instanceof Geometry) {
      Geometry g = (Geometry) o;
      // TODO: check userData for crs... and ensure its of the same
      // crs as the feature type
      if (bounds.isNull()) {
        bounds.init(JTS.bounds(g, crs));
      } else {
        bounds.expandToInclude(JTS.bounds(g, crs));
      }
    }
  }
  return (BoundingBox) bounds;
}

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

@Override
public BoundingBox getBounds() {
  Object o = getDefaultGeometry();
  if (o instanceof Geometry) {
    CoordinateReferenceSystem crs = featureType.getCoordinateReferenceSystem();
    if (crs == null) {
      crs = DefaultGeographicCRS.WGS84;
    }
    Envelope bounds = ReferencedEnvelope.create(crs);
    bounds.init(JTS.bounds((Geometry) o, crs));
    return (BoundingBox) bounds;
  }
  return null;
}

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

JTS.bounds(geometry, descriptor.getCoordinateReferenceSystem());

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

JTS.bounds(
    geometry,
    ((GeometryDescriptor) att).getCoordinateReferenceSystem());

代码示例来源:origin: org.geogit/geogit-core

@Override
public BoundingBox getBounds() {
  CoordinateReferenceSystem crs = featureType.getCoordinateReferenceSystem();
  Envelope bounds = ReferencedEnvelope.create(crs);
  Optional<Object> o;
  for (int i = 0; i < revFeatureValues.size(); i++) {
    o = revFeatureValues.get(i);
    if (o.isPresent() && o.get() instanceof Geometry) {
      Geometry g = (Geometry) o.get();
      // TODO: check userData for crs... and ensure its of the same
      // crs as the feature type
      if (bounds.isNull()) {
        bounds.init(JTS.bounds(g, crs));
      } else {
        bounds.expandToInclude(JTS.bounds(g, crs));
      }
    }
  }
  return (BoundingBox) bounds;
}

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

Geometry g = (Geometry) o.get();
if (bounds.isNull()) {
  bounds.init(JTS.bounds(g, crs));
} else {
  bounds.expandToInclude(JTS.bounds(g, crs));

相关文章