本文整理了Java中com.vividsolutions.jts.geom.Geometry.intersects()
方法的一些代码示例,展示了Geometry.intersects()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Geometry.intersects()
方法的具体详情如下:
包路径:com.vividsolutions.jts.geom.Geometry
类名称:Geometry
方法名:intersects
[英]Tests whether this geometry intersects the argument geometry.
The intersects
predicate has the following equivalent definitions:
The two geometries have at least one point in common
The DE-9IM Intersection Matrix for the two geometries matches at least one of the patterns
[T********]
[*T*******]
[***T*****]
[****T****]
! g.disjoint(this) = true
(intersects
is the inverse of disjoint
)
[中]测试此几何图形是否与参数几何图形相交。intersects
谓词具有以下等效定义:
*这两种几何图形至少有一个共同点
*两种几何图形的DE-9IM相交矩阵至少与其中一种图案匹配
[T********]
[*T*******]
[***T*****]
[****T****]
! g.disjoint(this) = true
(intersects
是disjoint
的倒数)
代码示例来源:origin: com.vividsolutions/jts
/**
* Default implementation.
*/
public boolean intersects(Geometry g)
{
return baseGeom.intersects(g);
}
代码示例来源:origin: com.vividsolutions/jts
/**
* Tests whether this geometry is disjoint from the argument geometry.
* <p>
* The <code>disjoint</code> predicate has the following equivalent definitions:
* <ul>
* <li>The two geometries have no point in common
* <li>The DE-9IM Intersection Matrix for the two geometries matches
* <code>[FF*FF****]</code>
* <li><code>! g.intersects(this) = true</code>
* <br>(<code>disjoint</code> is the inverse of <code>intersects</code>)
* </ul>
*
*@param g the <code>Geometry</code> with which to compare this <code>Geometry</code>
*@return <code>true</code> if the two <code>Geometry</code>s are
* disjoint
*
* @see Geometry#intersects
*/
public boolean disjoint(Geometry g) {
return ! intersects(g);
}
代码示例来源:origin: opentripplanner/OpenTripPlanner
for (NamedArea area : intersects) {
Geometry polygon = area.getPolygon();
if (!polygon.intersects(startPoint))
continue;
Geometry lineParts = line.intersection(polygon);
代码示例来源:origin: com.vividsolutions/jts
static List findIntersecting(Collection targetGeoms, Geometry queryGeom)
{
List result = new ArrayList();
for (Iterator it = targetGeoms.iterator(); it.hasNext(); ) {
Geometry test = (Geometry) it.next();
if (test.intersects(queryGeom)) {
result.add(test);
}
}
return result;
}
}
代码示例来源:origin: opentripplanner/OpenTripPlanner
MultiPolygon polygon = area.toJTSMultiPolygon();
if (!(polygon.intersects(startPoint) || polygon.getBoundary()
.intersects(startPoint)))
continue;
Geometry lineParts = line.intersection(polygon);
代码示例来源:origin: org.geotools/gt-main
static public boolean intersects(Geometry arg0,Geometry arg1)
{
if (arg0 == null || arg1 == null) return false;
Geometry _this = arg0;
return _this.intersects(arg1);
}
代码示例来源:origin: com.vividsolutions/jts-core
/**
* Default implementation.
*/
public boolean intersects(Geometry g)
{
return baseGeom.intersects(g);
}
代码示例来源:origin: DataSystemsLab/GeoSpark
public boolean match(Geometry spatialObject, Geometry queryWindow)
{
if (considerBoundaryIntersection) {
if (queryWindow.intersects(spatialObject)) { return true; }
}
else {
if (queryWindow.covers(spatialObject)) { return true; }
}
return false;
}
}
代码示例来源:origin: DataSystemsLab/GeoSpark
private boolean geoMatch(Geometry left, Geometry right)
{
//log.warn("Check "+left.toText()+" with "+right.toText());
return considerBoundaryIntersection ? left.intersects(right) : left.covers(right);
}
}
代码示例来源:origin: org.datasyslab/geospark
private boolean geoMatch(Geometry left, Geometry right)
{
//log.warn("Check "+left.toText()+" with "+right.toText());
return considerBoundaryIntersection ? left.intersects(right) : left.covers(right);
}
}
代码示例来源:origin: org.datasyslab/geospark
public boolean match(Geometry spatialObject, Geometry queryWindow)
{
if (considerBoundaryIntersection) {
if (queryWindow.intersects(spatialObject)) { return true; }
}
else {
if (queryWindow.covers(spatialObject)) { return true; }
}
return false;
}
}
代码示例来源:origin: org.geotools/gt-coverage
/**
* Helper method for {@link #intersects(Geometry, Geometry) intersects(Geometry, Geometry)}
*/
private static boolean intersects(GeometryCollection gc, Geometry g) {
final int size=gc.getNumGeometries();
for (int i = 0; i < size; i++) {
Geometry g1 = (Geometry)gc.getGeometryN(i);
if( g1.intersects(g) )
return true;
}
return false;
}
代码示例来源:origin: org.jboss.teiid/teiid-engine
public static Boolean intersects(GeometryType geom1, GeometryType geom2) throws FunctionExecutionException {
Geometry g1 = getGeometry(geom1);
Geometry g2 = getGeometry(geom2);
return g1.intersects(g2);
}
代码示例来源:origin: org.teiid/teiid-engine
public static Boolean intersects(GeometryType geom1, GeometryType geom2) throws FunctionExecutionException {
Geometry g1 = getGeometry(geom1);
Geometry g2 = getGeometry(geom2);
return g1.intersects(g2);
}
代码示例来源:origin: BaseXdb/basex
@Override
public Item item(final QueryContext qc, final InputInfo ii) throws QueryException {
return Bln.get(checkGeo(0, qc).intersects(checkGeo(1, qc)));
}
}
代码示例来源:origin: org.geotools/gt-main
protected final boolean basicEvaluate(Geometry left, Geometry right) {
Envelope envLeft = left.getEnvelopeInternal();
Envelope envRight = right.getEnvelopeInternal();
return envRight.intersects(envLeft) && left.intersects(right);
}
代码示例来源:origin: org.geotools/gt-main
protected boolean basicEvaluate(Geometry left, Geometry right) {
Envelope envLeft = left.getEnvelopeInternal();
Envelope envRight = right.getEnvelopeInternal();
if (envRight.intersects(envLeft)) {
return left.intersects(right);
} else {
return false;
}
// Note that this is a pretty permissive logic
// if the type has somehow been mis-set (can't happen externally)
// then true is returned in all cases
}
代码示例来源:origin: org.jboss.teiid/teiid-engine
public static boolean boundingBoxIntersects(
GeometryType geom1, GeometryType geom2) throws FunctionExecutionException {
Geometry g1 = getGeometry(geom1);
Geometry g2 = getGeometry(geom2);
return g1.getEnvelope().intersects(g2.getEnvelope());
}
代码示例来源:origin: org.teiid/teiid-engine
public static boolean boundingBoxIntersects(
GeometryType geom1, GeometryType geom2) throws FunctionExecutionException {
Geometry g1 = getGeometry(geom1);
Geometry g2 = getGeometry(geom2);
return g1.getEnvelope().intersects(g2.getEnvelope());
}
代码示例来源:origin: org.geotools/gt2-main
public boolean evaluate(Object feature) {
if (feature instanceof Feature && !validate((Feature)feature))
return false;
Geometry left = getLeftGeometry(feature);
Geometry right = getRightGeometry(feature);
Envelope envLeft = left.getEnvelopeInternal();
Envelope envRight = right.getEnvelopeInternal();
if(envRight.intersects(envLeft))
return left.intersects(right);
else
return false;
}
内容来源于网络,如有侵权,请联系作者删除!