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

x33g5p2x  于2022-01-26 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(266)

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

Polygon.getInteriorPoint介绍

暂无

代码示例

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

public Point getInteriorPoint() {
  return polygon.getInteriorPoint();
}

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

if (rPolygon.covers(pPolygon.getInteriorPoint())) {

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

@DescribeProcess(title = "Split Polygon", description = "Splits a polygon by a linestring")
@DescribeResult(description = "The collection of split polygons")
public static Geometry splitPolygon(
    @DescribeParameter(name = "polygon", description = "Polygon to split") Geometry polygon,
    @DescribeParameter(name = "line", description = "Linestring to split by")
        LineString line) {
  Geometry nodedLinework = polygon.getBoundary().union(line);
  Geometry polys = polygonize(nodedLinework);
  // Only keep polygons which are inside the input
  List<Polygon> output = new ArrayList<Polygon>();
  for (int i = 0; i < polys.getNumGeometries(); i++) {
    Polygon candpoly = (Polygon) polys.getGeometryN(i);
    // use interior point to test for inclusion in parent
    if (polygon.contains(candpoly.getInteriorPoint())) {
      output.add(candpoly);
    }
  }
  return polygon.getFactory()
      .createGeometryCollection(GeometryFactory.toGeometryArray(output));
}

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

/**
 * Splits a Polygon using a LineString.
 *
 * @param polygon
 * @param lineString
 * @return
 */
private static Collection<Polygon> polygonWithLineSplitter(Polygon polygon, LineString lineString) throws SQLException {
  Collection<Polygon> polygons = splitPolygonizer(polygon, lineString);
  if (polygons != null && polygons.size() > 1) {
    List<Polygon> pols = new ArrayList<Polygon>();
    for (Polygon pol : polygons) {
      if (polygon.contains(pol.getInteriorPoint())) {
        pols.add(pol);
      }
    }
    return pols;
  }
  return null;
}

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

for (Object object : polygonizer.getPolygons()) {
  Polygon polygon = (Polygon) object;
  Coordinate p = polygon.getInteriorPoint().getCoordinate();
  int location = RayCrossingCounter.locatePointInRing(p, ring.getCoordinateSequence());
  if (location == Location.INTERIOR) {

相关文章