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

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

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

Geometry.touches介绍

[英]Tests whether this geometry touches the argument geometry.

The touches predicate has the following equivalent definitions:

  • The geometries have at least one point in common, but their interiors do not intersect.

  • The DE-9IM Intersection Matrix for the two geometries matches at least one of the following patterns

  • [FT*******]

    • [F**T*****]
    • [F***T****]
      If both geometries have dimension 0, the predicate returns false, since points have only interiors. This predicate is symmetric.
      [中]测试此几何图形是否接触参数几何图形。
      touches谓词具有以下等效定义:
      *这些几何图形至少有一个公共点,但它们的内部不相交。
      *两种几何图形的DE-9IM相交矩阵至少与以下模式之一匹配
  • [FT*******]

  • [F**T*****]

  • [F***T****]
    如果两个几何图形的尺寸均为0,则谓词将返回false,因为点只有内部。这个谓词是对称的。

代码示例

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

  1. public static boolean touches(Geometry arg0, Geometry arg1) {
  2. if (arg0 == null || arg1 == null) return false;
  3. Geometry _this = arg0;
  4. return _this.touches(arg1);
  5. }

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

  1. public boolean touches(Geometry g) {
  2. return geometry.touches(g);
  3. }

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

  1. public boolean evaluateInternal(Geometry left, Geometry right) {
  2. return left.touches(right);
  3. }

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

  1. @DescribeProcess(
  2. title = "Touches Test",
  3. description =
  4. "Tests if two geometries have at least one boundary point in common, but share no interior points."
  5. )
  6. @DescribeResult(description = "True if the inputs touch")
  7. public static boolean touches(
  8. @DescribeParameter(name = "a", description = "First input geometry") Geometry a,
  9. @DescribeParameter(name = "b", description = "Second input geometry") Geometry b) {
  10. return a.touches(b);
  11. }

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

  1. /**
  2. * Default implementation.
  3. */
  4. public boolean touches(Geometry g)
  5. {
  6. return baseGeom.touches(g);
  7. }

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

  1. @Override
  2. public boolean apply(Geometry geom1, Geometry geom2) {
  3. return geom1.touches(geom2);
  4. }
  5. }

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

  1. /**
  2. * Return true if the geometry A touches the geometry B
  3. * @param a Geometry Geometry.
  4. * @param b Geometry instance
  5. * @return true if the geometry A touches the geometry B
  6. */
  7. public static Boolean geomTouches(Geometry a,Geometry b) {
  8. if(a==null || b==null) {
  9. return null;
  10. }
  11. return a.touches(b);
  12. }
  13. }

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

  1. public static boolean touches(Geometry a, Geometry b) { return a.touches(b); }
  2. }

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

  1. Geometry gt2 = (Geometry) tmp2.getDefaultGeometry();
  2. if (gt2.touches(gt)) {
  3. return false;

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

  1. if (g1.touches(g2) != expected) {
  2. results.error(
  3. f1,

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

  1. /**
  2. * Returns TRUE if the geometries have at least one point in common, but their interiors do not
  3. * intersect.
  4. */
  5. public static boolean ST_Touches( byte[] wkb1, byte[] wkb2) {
  6. if ( wkb1 == null || wkb2 == null ) {
  7. return false;
  8. }
  9. Geometry g1 = gFromWKB(wkb1);
  10. Geometry g2 = gFromWKB(wkb2);
  11. return g1.touches( g2 );
  12. }

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

  1. /**
  2. * Returns TRUE if the geometries have at least one point in common, but their interiors do not
  3. * intersect.
  4. */
  5. public static boolean ST_Touches( byte[] wkb1, byte[] wkb2) {
  6. if ( wkb1 == null || wkb2 == null ) {
  7. return false;
  8. }
  9. Geometry g1 = gFromWKB(wkb1);
  10. Geometry g2 = gFromWKB(wkb2);
  11. return g1.touches( g2 );
  12. }

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

  1. SimpleFeature f2 = fr2.next();
  2. Geometry g2 = (Geometry) f2.getDefaultGeometry();
  3. if (g1.touches(g2) != expected) {
  4. results.error(
  5. f1,

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

  1. public void doPredicates(Geometry a, Geometry b) throws Exception
  2. {
  3. assertTrue( a.contains(b) == a.relate(b).isContains() );
  4. assertTrue( a.crosses(b) == a.relate(b).isCrosses(a.getDimension(), b.getDimension()) );
  5. assertTrue( a.disjoint(b) == a.relate(b).isDisjoint() );
  6. assertTrue( a.equals(b) == a.relate(b).isEquals(a.getDimension(), b.getDimension()) );
  7. assertTrue( a.intersects(b) == a.relate(b).isIntersects() );
  8. assertTrue( a.overlaps(b) == a.relate(b).isOverlaps(a.getDimension(), b.getDimension()) );
  9. assertTrue( a.touches(b) == a.relate(b).isTouches(a.getDimension(), b.getDimension()) );
  10. assertTrue( a.within(b) == a.relate(b).isWithin() );
  11. }

相关文章