本文整理了Java中org.locationtech.jts.geom.Polygon.covers()
方法的一些代码示例,展示了Polygon.covers()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Polygon.covers()
方法的具体详情如下:
包路径:org.locationtech.jts.geom.Polygon
类名称:Polygon
方法名:covers
暂无
代码示例来源:origin: geotools/geotools
public boolean covers(Geometry g) {
return polygon.covers(g);
}
代码示例来源:origin: mapsforge/mapsforge
if (polygonGeometries[k].covers(polygonGeometries[l])) {
List<Integer> inners = this.outerToInner.get(Integer.valueOf(k));
if (inners == null) {
inner.add(Integer.valueOf(l));
} else if (!this.outerToInner.containsKey(Integer.valueOf(k))
&& polygonGeometries[l].covers(polygonGeometries[k])) {
List<Integer> inners = this.outerToInner.get(Integer.valueOf(l));
if (inners == null) {
代码示例来源:origin: mapsforge/mapsforge
if (rPolygon.covers(pPolygon.getInteriorPoint())) {
代码示例来源:origin: orbisgis/h2gis
/**
*
* @param g1 Geometry instance or null
* @param g2 Geometry instance or null
* @return minimum distance in meters between two geometries
*/
private static Double distancePointPolygon(Geometry g1, Geometry g2) {
Double distance = Double.MAX_VALUE;
Double ringDistance;
Point point;
Polygon polygon;
if (g1 instanceof Polygon) {
point = (Point) g2;
polygon = (Polygon) g1;
} else {
point = (Point) g1;
polygon = (Polygon) g2;
}
if (polygon.covers(point)) {
return 0.0;
}
for (int i = 0; i < polygon.getExteriorRing().getNumPoints(); i++) {
ringDistance = distancePointToPoint(polygon.getExteriorRing().getPointN(i), point);
if (ringDistance < distance) {
distance = ringDistance;
}
}
return distance;
}
内容来源于网络,如有侵权,请联系作者删除!