MultiPolygon是指由多个多边形组成的几何对象。在地理信息系统中,MultiPolygon常用于表示具有复杂边界的区域或地块。每个MultiPolygon由多个Polygon组成,每个Polygon由多个线串(LinearRing)组成。计算MultiPolygon之间的相交面积,实际上是计算多个Polygon之间的相交面积的和。 JTS库的使用 首先,我们需要引入JTS库的依赖。可以在Maven...
MultiPolygon multiPolygon=geometryFactory.createMultiPolygon(polygons.toArray(newPolygon[polygons.size()])); } } 在上述代码中,我们首先创建了一个Polygonizer对象,并使用其add方法将线性几何对象添加到polygonizer中。然后,我们使用polygonizer的getPolygons方法获取多边形结果,这将返回一个Polygon的集合。最后,我们使...
import com.vividsolutions.jts.geom.*; public class PolygonSplitExample { public static void main(String[] args) { // 创建多边形对象 Coordinate[] coordinates = new Coordinate[]{ new Coordinate(0, 0), new Coordinate(0, 5), new Coordinate(5, 5), new Coordinate(5, 0), new Coordinate(0, ...
/ create a valid version of the geometry given. If the geometry is a polygon or multi polygon...
read("MULTIPOLYGON(((40 10, 30 0, 40 10, 30 20, 40 10),(30 10, 30 0, 40 10, 30 20, 30 10)))"); 几何集合列表-GeometryCollection LineString line = createLine(); Polygon poly = createPolygonByWKT(); Geometry g1 = geometryFactory.createGeometry(line); Geometry g2 = geometry...
方法名:toPolygonArray GeometryFactory.toPolygonArray介绍 [英]Converts theListto an array. [中]将List转换为数组。 代码示例 代码示例来源:origin: geotools/geotools Polygon[]polygonArray=geometryFactory.toPolygonArray(geometries); MultiPolygonmultiPolygon=geometryFactory.createMultiPolygon(polygonArray); ...
| <MultiPolygon Tagged Text> | <GeometryCollection Tagged Text> <Point Tagged Text> := POINT <Point Text> <LineString Tagged Text> := LINESTRING <LineString Text> <LinearRing Tagged Text> := LINEARRING <LineString Text> <Polygon Tagged Text> := ...
坐标边界查询工具:使用jts库从省市区县乡镇边界数据或geojson边界数据文件中查找出和任意点、线、面有相交的矢量边界,提供HTTP API接口,内存占用低,性能优良(1秒可查1万个以上坐标对应的城市信息) geometry polygon geotools jts multipolygon intersects stintersects stcontains Updated May 11, 2024 Java wd...
类名称:MultiPolygon 方法名:getNumGeometries MultiPolygon.getNumGeometries介绍 暂无 代码示例 代码示例来源:origin: graphhopper/graphhopper intmaxPoints=0; PolygonmaxPolygon=null; for(intj=0;j<multiPolygon.getNumGeometries();j++){ Polygonpolygon=(Polygon)multiPolygon.getGeometryN(j); ...
perimeter += getPerimeter(multiPolygon.getGeometryN(i)); } return perimeter; } 代码示例来源:origin: geotools/geotools /** * Like makeGoodShapePolygon, but applied towards a multi polygon. * * @param mp The MultiPolygon to "niceify". * @return The "nicified" MultiPolygon. */ public stat...