本文整理了Java中com.vividsolutions.jts.geom.Polygon.clone()
方法的一些代码示例,展示了Polygon.clone()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Polygon.clone()
方法的具体详情如下:
包路径:com.vividsolutions.jts.geom.Polygon
类名称:Polygon
方法名:clone
[英]Creates and returns a full copy of this Polygon object. (including all coordinates contained by it).
[中]创建并返回此多边形对象的完整副本。(包括其包含的所有坐标)。
代码示例来源:origin: org.geotools/gt-render
public Object clone() {
return polygon.clone();
}
代码示例来源:origin: org.orbisgis/h2gis-functions
/**
* Extract the roof of a polygon
*
* @param polygon
* @param height
* @return
*/
public static Polygon extractRoof(Polygon polygon, double height) {
GeometryFactory factory = polygon.getFactory();
Polygon roofP = (Polygon) polygon.clone();
roofP.apply(new TranslateCoordinateSequenceFilter(height));
final LinearRing shell = factory.createLinearRing(getCounterClockWise(roofP.getExteriorRing()).getCoordinates());
final int nbOfHoles = roofP.getNumInteriorRing();
final LinearRing[] holes = new LinearRing[nbOfHoles];
for (int i = 0; i < nbOfHoles; i++) {
holes[i] = factory.createLinearRing(getClockWise(
roofP.getInteriorRingN(i)).getCoordinates());
}
return factory.createPolygon(shell, holes);
}
代码示例来源:origin: org.orbisgis/h2gis
/**
* Extract the roof of a polygon
*
* @param polygon
* @param height
* @return
*/
public static Polygon extractRoof(Polygon polygon, double height) {
GeometryFactory factory = polygon.getFactory();
Polygon roofP = (Polygon) polygon.clone();
roofP.apply(new TranslateCoordinateSequenceFilter(height));
final LinearRing shell = factory.createLinearRing(getCounterClockWise(roofP.getExteriorRing()).getCoordinates());
final int nbOfHoles = roofP.getNumInteriorRing();
final LinearRing[] holes = new LinearRing[nbOfHoles];
for (int i = 0; i < nbOfHoles; i++) {
holes[i] = factory.createLinearRing(getClockWise(
roofP.getInteriorRingN(i)).getCoordinates());
}
return factory.createPolygon(shell, holes);
}
内容来源于网络,如有侵权,请联系作者删除!