我有一些 3D 几何图形,我想用新坐标返回一个 2D 几何图形(维度 2):
private static Geometry convert2D(Geometry g3D) {
// copy geometry
Geometry g2D = (Geometry) g3D.clone();
Geometry geometry;
// set new 2D coordinates
for (Coordinate c : g2D.getCoordinates()) {
c.setCoordinate(new Coordinate(c.x, c.y));
}
// SET NEW COORDINATES TO g2D
return g2D;
}
由于对象几何体没有该方法,我该怎么做setCoordinates
?