org.locationtech.jts.geom.Polygon.getArea()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(1.3k)|赞(0)|评价(0)|浏览(424)

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

Polygon.getArea介绍

[英]Returns the area of this Polygon
[中]返回此Polygon的面积

代码示例

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

public double getArea() {
  return polygon.getArea();
}

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

private ReferencedEnvelope reduceEnvelope(
    ReferencedEnvelope envelope, ProjectionHandler handler)
    throws TransformException, FactoryException {
  Polygon polygon = JTS.toGeometry(envelope);
  Geometry geom = handler.preProcess(polygon);
  if (geom == null) {
    return null;
  }
  PolygonExtractor pe = new PolygonExtractor();
  Polygon largest = null;
  for (Polygon p : pe.getPolygons(geom)) {
    if (largest == null || largest.getArea() > p.getArea()) {
      largest = p;
    }
  }
  ReferencedEnvelope reduced =
      new ReferencedEnvelope(
          largest.getEnvelopeInternal(), envelope.getCoordinateReferenceSystem());
  return reduced;
}

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

for (int t = 0; t < clippedPolys.size(); t++) {
  cpoly = clippedPolys.get(t);
  final double area = cpoly.getArea();
  if (area > maxSize) {
    maxPoly = cpoly;

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

if (ring.getFactory().createPolygon(ring).getArea() > 0) {
  return ring;
} else {

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

double polygonArea = polygon.getArea();
if (polygonArea > area) {
  polygonIndex = index;

相关文章