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

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

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

Geometry.isSimple介绍

[英]Tests whether this Geometry is simple. The SFS definition of simplicity follows the general rule that a Geometry is simple if it has no points of self-tangency, self-intersection or other anomalous points.

Simplicity is defined for each Geometry subclass as follows:

  • Valid polygonal geometries are simple, since their rings must not self-intersect. isSimple tests for this condition and reports false if it is not met. (This is a looser test than checking for validity).
  • Linear rings have the same semantics.
  • Linear geometries are simple iff they do not self-intersect at points other than boundary points.
  • Zero-dimensional geometries (points) are simple iff they have no repeated points.
  • Empty Geometrys are always simple.
    [中]测试此几何图形是否简单。SFS简单性定义遵循的一般规则是,如果几何体没有自切点、自相交点或其他异常点,则几何体是简单的。
    每个几何体子类的简单性定义如下:
    *有效的多边形几何体很简单,因为它们的环不能自相交。isSimple测试此条件,如果不满足,则报告false。(这是一个比检查有效性更宽松的测试)。
    *线性环具有相同的语义。
    *线性几何体很简单,除非它们在边界点以外的点上不自相交。
    *零维几何(点)是简单的,如果它们没有重复的点。
    *空的Geometry总是很简单的。

代码示例

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

public static boolean isSimple(Geometry arg0) {
  if (arg0 == null) return false;
  Geometry _this = arg0;
  return _this.isSimple();
}

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

public boolean isSimple() {
  return geometry.isSimple();
}

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

@DescribeProcess(
  title = "Simple Test",
  description =
      "Tests if a geometry is topologically simple. Points, polygons, closed line strings, and linear rings are always simple. Other geometries are considered simple if no two points are identical."
)
@DescribeResult(description = "True if the input is simple")
public static boolean isSimple(
    @DescribeParameter(name = "geom", description = "Input geometry") Geometry geom) {
  return geom.isSimple();
}

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

/**
   * @param geometry Geometry instance
   * @return True if the provided geometry has no points of self-tangency, self-intersection or other anomalous points.
   */
  public static Boolean isSimple(Geometry geometry) {
    if(geometry==null) {
      return null;
    }
    return geometry.isSimple();
  }
}

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

public static boolean isSimple(Geometry g)		{		return g.isSimple();	}
public static boolean isValid(Geometry g)			{		return g.isValid();	}

代码示例来源:origin: Geomatys/geotoolkit

/**
 * Returns true if this object does not cross itself.
 */
@Override
public final boolean isSimple() {
  org.locationtech.jts.geom.Geometry jtsGeom = getJTSGeometry();
  return jtsGeom.isSimple();
}

代码示例来源:origin: org.opengeo/geodb

/**
 * Returns (TRUE) if this Geometry has no anomalous geometric points, such as self intersection 
 * or self tangency.
 */
public static boolean ST_IsSimple ( byte[] wkb ) {
  if ( wkb == null ) {
    return false;
  }
  
  Geometry g = gFromWKB(wkb);
  return g.isSimple();
}

代码示例来源:origin: jdeolive/geodb

/**
 * Returns (TRUE) if this Geometry has no anomalous geometric points, such as self intersection 
 * or self tangency.
 */
public static boolean ST_IsSimple ( byte[] wkb ) {
  if ( wkb == null ) {
    return false;
  }
  
  Geometry g = gFromWKB(wkb);
  return g.isSimple();
}

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

/**
   * @param geometry Geometry instance
   * @return True if the provided geometry is a ring; null otherwise
   */
  public static Boolean isRing(Geometry geometry) {
    if(geometry==null){
      return null;
    }
    if (geometry instanceof MultiLineString) {
      MultiLineString mString = ((MultiLineString) geometry);
      return mString.isClosed() && mString.isSimple();
    } else if (geometry instanceof LineString) {
      LineString line = (LineString) geometry;
      return line.isClosed() && geometry.isSimple();
    }
    return null;
  }
}

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

public void testMultiPolygonIsSimple2() throws Exception {
 Geometry g = reader.read("MULTIPOLYGON("
    + "((10 10, 10 20, 20 20, 20 15, 10 10)), "
    + "((60 60, 70 70, 80 60, 60 60))  )");
 assertTrue(g.isSimple());
}

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

public void testPointIsSimple() throws Exception {
 Geometry g = reader.read("POINT (10 10)");
 assertTrue(g.isSimple());
}

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

public void testPolygonIsSimple() throws Exception {
 Geometry g = reader.read("POLYGON((10 10, 10 20, 202 0, 20 15, 10 10))");
 assertTrue(g.isSimple());
}

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

public void testMultiPolygonIsSimple1() throws Exception {
 Geometry g = reader.read("MULTIPOLYGON (((10 10, 10 20, 20 20, 20 15, 10 10)), ((60 60, 70 70, 80 60, 60 60)))");
 assertTrue(g.isSimple());
}

相关文章