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

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

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

Geometry.crosses介绍

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

The crosses predicate has the following equivalent definitions:

  • The geometries have some but not all interior points in common.

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

  • [T*T******] (for P/L, P/A, and L/A situations)

    • [T*****T**] (for L/P, A/P, and A/L situations)
    • [0********] (for L/L situations)
      For any other combination of dimensions this predicate returns false.

The SFS defined this predicate only for P/L, P/A, L/L, and L/A situations. In order to make the relation symmetric, JTS extends the definition to apply to L/P, A/P and A/L situations as well.
[中]测试此几何图形是否与参数几何图形交叉。
crosses谓词具有以下等效定义:
*这些几何图形有一些但不是所有的内部点是相同的。
*两种几何图形的DE-9IM相交矩阵与以下模式之一匹配:
*[T*T******](适用于P/L、P/A和L/A情况)
*[T*****T**](适用于L/P、A/P和A/L情况)
*[0********](对于L/L情况)
对于任何其他维度组合,此谓词返回false
SFS仅针对P/L、P/A、L/L和L/A情况定义了此谓词。为了使关系对称,JTS将定义扩展到适用于L/P、A/P和A/L情况。

代码示例

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

public static boolean crosses(Geometry arg0, Geometry arg1) {
  if (arg0 == null || arg1 == null) return false;
  Geometry _this = arg0;
  return _this.crosses(arg1);
}

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

public boolean crosses(Geometry g) {
  return geometry.crosses(g);
}

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

@Override
public boolean evaluateInternal(Geometry left, Geometry right) {
  Envelope envLeft = left.getEnvelopeInternal();
  Envelope envRight = right.getEnvelopeInternal();
  if (envRight.intersects(envLeft)) return left.crosses(right);
  return false;
}

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

@DescribeProcess(
  title = "Crosses Test",
  description = "Tests if two geometries have some, but not all, interior points in common."
)
@DescribeResult(description = "True if the inputs cross")
public static boolean crosses(
    @DescribeParameter(name = "a", description = "First input geometry") Geometry a,
    @DescribeParameter(name = "b", description = "Second input geometry") Geometry b) {
  return a.crosses(b);
}

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

if (geom.crosses((Geometry) geoms.get(i))) {
  results.error(feature, "Lines cross when they shouldn't.");
  result = false;

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

/**
 * Default implementation.
 */
public boolean crosses(Geometry g)
{
 return baseGeom.crosses(g);
}

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

@Override
 public boolean apply(Geometry geom1, Geometry geom2) {
  return geom1.crosses(geom2);
 }
}

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

/**
   * @param a Geometry Geometry.
   * @param b Geometry instance
   * @return true if Geometry A crosses Geometry B
   */
  public static Boolean geomCrosses(Geometry a,Geometry b) {
    if(a==null || b==null) {
      return null;
    }
    return a.crosses(b);
  }
}

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

public static boolean crosses(Geometry a, Geometry b) {    return a.crosses(b);    }
public static boolean disjoint(Geometry a, Geometry b) {    return a.disjoint(b);    }

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

if (g1.crosses(g2) != expected) {

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

/**
 * Returns TRUE if the supplied geometries have some, but not all, interior points in common.
 * 
 */
public static boolean ST_Crosses( byte[] wkb1, byte[] wkb2 ) {
  if ( wkb1 == null || wkb2 == null ) {
    return false;
  }
  
  Geometry g1 = gFromWKB(wkb1);
  Geometry g2 = gFromWKB(wkb2);
  
  return g1.crosses( g2 );
}

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

/**
 * Returns TRUE if the supplied geometries have some, but not all, interior points in common.
 * 
 */
public static boolean ST_Crosses( byte[] wkb1, byte[] wkb2 ) {
  if ( wkb1 == null || wkb2 == null ) {
    return false;
  }
  
  Geometry g1 = gFromWKB(wkb1);
  Geometry g2 = gFromWKB(wkb2);
  
  return g1.crosses( g2 );
}

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

public void doPredicates(Geometry a, Geometry b) throws Exception
{
 assertTrue( a.contains(b) == a.relate(b).isContains() );
 assertTrue( a.crosses(b) == a.relate(b).isCrosses(a.getDimension(), b.getDimension()) );
 assertTrue( a.disjoint(b) == a.relate(b).isDisjoint() );
 assertTrue( a.equals(b) == a.relate(b).isEquals(a.getDimension(), b.getDimension()) );
 assertTrue( a.intersects(b) == a.relate(b).isIntersects() );
 assertTrue( a.overlaps(b) == a.relate(b).isOverlaps(a.getDimension(), b.getDimension()) );
 assertTrue( a.touches(b) == a.relate(b).isTouches(a.getDimension(), b.getDimension()) );
 assertTrue( a.within(b) == a.relate(b).isWithin() );
}

相关文章