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

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

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

Polygon.getBoundary介绍

[英]Computes the boundary of this geometry
[中]计算此几何体的边界

代码示例

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

public Geometry getBoundary() {
  return polygon.getBoundary();
}

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

assertTrue(geometryFactory.createLinearRing(new Coordinate[] { }).getBoundary().isEmpty());
assertTrue(geometryFactory.createLineString(new Coordinate[] { }).getBoundary().isEmpty());
assertTrue(geometryFactory.createPolygon(geometryFactory.createLinearRing(new Coordinate[] { }), new LinearRing[] { }).getBoundary().isEmpty());
assertTrue(geometryFactory.createMultiPolygon(new Polygon[] { }).getBoundary().isEmpty());
assertTrue(geometryFactory.createMultiLineString(new LineString[] { }).getBoundary().isEmpty());

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

private Map<Poi, Map<String, String>> getPoisInsidePolygon(Polygon polygon) {
  Coordinate[] coordinates = polygon.getBoundary().getCoordinates();
  double minLat = coordinates[0].y;
  double minLon = coordinates[0].x;

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

if (!pt.getBoundary().within(ls)) {
  r = true;

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

if (!ls.getBoundary().contains(pt)) {
  r = true;

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

/**
 * Computes the boundary of this geometry
 *
 * @return a lineal geometry (which may be empty)
 * @see Geometry#getBoundary
 */
public Geometry getBoundary() {
 if (isEmpty()) {
  return getFactory().createMultiLineString();
 }
 ArrayList allRings = new ArrayList();
 for (int i = 0; i < geometries.length; i++) {
  Polygon polygon = (Polygon) geometries[i];
  Geometry rings = polygon.getBoundary();
  for (int j = 0; j < rings.getNumGeometries(); j++) {
   allRings.add(rings.getGeometryN(j));
  }
 }
 LineString[] allRingsArray = new LineString[allRings.size()];
 return getFactory().createMultiLineString((LineString[]) allRings.toArray(allRingsArray));
}

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

public void runStarCrossRing()
{
 int size = 1000;
 Envelope env =  new Envelope(0,100,0,100);
 Polygon poly = StarCross.star(env, size, geomFact);
 Geometry geom = poly.getBoundary();
 //System.out.println(geom);
 checkValid("StarCross " + geom.getGeometryType() + "   (size = " + size + " )", geom);
}

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

public void testBoundaryOfEmptyGeometry() throws Exception {
 assertTrue(geometryFactory.createPoint((Coordinate)null).getBoundary().getClass() == GeometryCollection.class);
 assertTrue(geometryFactory.createLinearRing(new Coordinate[] { }).getBoundary().getClass() == MultiPoint.class);
 assertTrue(geometryFactory.createLineString(new Coordinate[] { }).getBoundary().getClass() == MultiPoint.class);
 assertTrue(geometryFactory.createPolygon(geometryFactory.createLinearRing(new Coordinate[] { }), new LinearRing[] { }).getBoundary().getClass() == MultiLineString.class);
 assertTrue(geometryFactory.createMultiPolygon(new Polygon[] { }).getBoundary().getClass() == MultiLineString.class);
 assertTrue(geometryFactory.createMultiLineString(new LineString[] { }).getBoundary().getClass() == MultiPoint.class);
 assertTrue(geometryFactory.createMultiPoint(new Point[] { }).getBoundary().getClass() == GeometryCollection.class);
 try {
  geometryFactory.createGeometryCollection(new Geometry[] { }).getBoundary();
  assertTrue(false);
 }
 catch (IllegalArgumentException e) {
 }
}

相关文章