com.vividsolutions.jts.geom.Geometry.convexHull()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(179)

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

Geometry.convexHull介绍

[英]Computes the smallest convex Polygon that contains all the points in the Geometry. This obviously applies only to Geometry s which contain 3 or more points; the results for degenerate cases are specified as follows: Number of Points in argument Geometry``Geometry class of result 0 empty GeometryCollection1 Point2 LineString3 or more Polygon
[中]计算包含Geometry中所有点的最小凸面Polygon。这显然只适用于包含3点或更多点的Geometrys;退化情况的结果如下所示:结果0的参数Geometry``Geometry类中Points的数量为空GeometryCollection1Point2LineString3或更多Polygon

代码示例

代码示例来源:origin: com.vividsolutions/jts

Geometry convexHull = input.convexHull();

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

static public Geometry convexHull(Geometry arg0)
{
   if (arg0 == null) return null;
   Geometry _this = arg0;
   return _this.convexHull();
}

代码示例来源:origin: org.orbisgis/h2spatial

/**
   * @param geometry
   * @return smallest convex Polygon that contains all the points in the Geometry
   */
  public static Geometry convexHull(Geometry geometry) {
    if(geometry==null) {
      return null;
    }
    return geometry.convexHull();
  }
}

代码示例来源:origin: org.orbisgis/h2gis-functions

/**
   * @param geometry
   * @return smallest convex Polygon that contains all the points in the Geometry
   */
  public static Geometry convexHull(Geometry geometry) {
    if(geometry==null) {
      return null;
    }
    return geometry.convexHull();
  }
}

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

static public Geometry convexHull(Geometry arg0)
{
   Geometry _this = arg0;
   return _this.convexHull();
}

代码示例来源:origin: us.ihmc/ihmc-jmonkey-engine-toolkit

/** Converts it into a convexHull shape.*/
public static Geometry convertToConvexHull(Geometry g)
{
 return g.convexHull();
}

代码示例来源:origin: us.ihmc/IHMCJMonkeyEngineToolkit

/** Converts it into a convexHull shape.*/
public static Geometry convertToConvexHull(Geometry g)
{
 return g.convexHull();
}

代码示例来源:origin: org.orbisgis/h2gis

/**
   * @param geometry
   * @return smallest convex Polygon that contains all the points in the Geometry
   */
  public static Geometry convexHull(Geometry geometry) {
    if(geometry==null) {
      return null;
    }
    return geometry.convexHull();
  }
}

代码示例来源:origin: org.n52.wps/52n-wps-algorithm-impl

@Execute
  public void runAlgorithm() {
    result = data.convexHull();
  }
}

代码示例来源:origin: Stratio/cassandra-lucene-index

/**
 * Returns the convex hull of the specified {@link JtsGeometry}.
 *
 * @param shape the JTS shape to be transformed
 * @return the convex hull
 */
@Override
public JtsGeometry apply(JtsGeometry shape) {
  Geometry centroid = shape.getGeom().convexHull();
  return CONTEXT.makeShape(centroid);
}

代码示例来源:origin: BaseXdb/basex

@Override
 public Item item(final QueryContext qc, final InputInfo ii) throws QueryException {
  return toElement(checkGeo(0, qc).convexHull(), qc);
 }
}

代码示例来源:origin: deegree/deegree3

@Override
public Geometry getConvexHull() {
  com.vividsolutions.jts.geom.Geometry jtsGeom = getJTSGeometry().convexHull();
  return createFromJTS( jtsGeom, crs );
}

代码示例来源:origin: org.jboss.teiid/teiid-engine

public static GeometryType convexHull(GeometryType geom) throws FunctionExecutionException {
  Geometry g = getGeometry(geom);
  return getGeometryType(g.convexHull());
}

代码示例来源:origin: Stratio/cassandra-lucene-index

/**
 * Returns the convex hull of the specified {@link JtsGeometry}.
 *
 * @return the convex hull
 */
@Override
public JtsGeometry apply() {
  Geometry centroid = shape.apply().getGeom().convexHull();
  return CONTEXT.makeShape(centroid);
}

代码示例来源:origin: org.orbisgis/h2gis-functions

/**
 * Compute the max distance
 */
private void computeMaxDistance() {
  HashSet<Coordinate> coordinatesA = new HashSet<Coordinate>();
  coordinatesA.addAll(Arrays.asList(geomA.convexHull().getCoordinates()));
  Geometry fullHull = geomA.getFactory().createGeometryCollection(new Geometry[]{geomA, geomB}).convexHull();
  maxDistanceFilter = new MaxDistanceFilter(coordinatesA);
  fullHull.apply(maxDistanceFilter);
}

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

public static GeometryType convexHull(GeometryType geom) throws FunctionExecutionException {
  Geometry g = getGeometry(geom);
  return getGeometryType(g.convexHull(), geom.getSrid());
}

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

/**
 * Returns the geometric convex hull of this geometry.
 */
public final Geometry getConvexHull() {
  com.vividsolutions.jts.geom.Geometry jtsGeom = getJTSGeometry();
  com.vividsolutions.jts.geom.Geometry jtsHull = jtsGeom.convexHull();
  return JTSUtils.jtsToGo1(jtsHull, getCoordinateReferenceSystem());
}

代码示例来源:origin: org.teiid/teiid-engine

public static GeometryType convexHull(GeometryType geom) throws FunctionExecutionException {
  Geometry g = getGeometry(geom);
  return getGeometryType(g.convexHull(), geom.getSrid());
}

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

/**
 * Returns the geometric convex hull of this geometry.
 */
public final Geometry getConvexHull() {
  com.vividsolutions.jts.geom.Geometry jtsGeom = getJTSGeometry();
  com.vividsolutions.jts.geom.Geometry jtsHull = jtsGeom.convexHull();
  return JTSUtils.jtsToGo1(jtsHull, getCoordinateReferenceSystem());
}

代码示例来源:origin: org.orbisgis/h2gis

/**
 * Compute the max distance
 */
private void computeMaxDistance() {
  HashSet<Coordinate> coordinatesA = new HashSet<Coordinate>();
  coordinatesA.addAll(Arrays.asList(geomA.convexHull().getCoordinates()));
  Geometry fullHull = geomA.getFactory().createGeometryCollection(new Geometry[]{geomA, geomB}).convexHull();
  maxDistanceFilter = new MaxDistanceFilter(coordinatesA);
  fullHull.apply(maxDistanceFilter);
}

相关文章