本文整理汇总了Java中oracle.spatial.geometry.JGeometry.createLinearPolygon方法的典型用法代码示例。如果您正苦于以下问题:Java JGeometry.createLinearPolygon方法的具体用法?Java JGeometry.createLinearPolygon怎么用?Java JGeometry.createLinearPolygon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oracle.spatial.geometry.JGeometry
的用法示例。
在下文中一共展示了JGeometry.createLinearPolygon方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convertPolygonToJGeometry
import oracle.spatial.geometry.JGeometry; //导入方法依赖的package包/类
private JGeometry convertPolygonToJGeometry(GeometryObject geomObj) {
if (geomObj.getNumElements() == 1) {
return JGeometry.createLinearPolygon(geomObj.getCoordinates(0), geomObj.getDimension(), geomObj.getSrid());
} else {
Object[] objectArray = new Object[geomObj.getNumElements()];
for (int i = 0; i < geomObj.getNumElements(); i++)
objectArray[i] = geomObj.getCoordinates(i);
return JGeometry.createLinearPolygon(objectArray, geomObj.getDimension(), geomObj.getSrid());
}
}
示例2: convertEnvelopeToJGeometry
import oracle.spatial.geometry.JGeometry; //导入方法依赖的package包/类
private JGeometry convertEnvelopeToJGeometry(GeometryObject geomObj) {
int dimension = geomObj.getDimension();
double[] coordinates = new double[5 * dimension];
int i = 0;
if (dimension == 3) {
coordinates[i++] = geomObj.getCoordinates()[0][0];
coordinates[i++] = geomObj.getCoordinates()[0][1];
coordinates[i++] = geomObj.getCoordinates()[0][2];
coordinates[i++] = geomObj.getCoordinates()[0][3];
coordinates[i++] = geomObj.getCoordinates()[0][1];
coordinates[i++] = geomObj.getCoordinates()[0][2];
coordinates[i++] = geomObj.getCoordinates()[0][3];
coordinates[i++] = geomObj.getCoordinates()[0][4];
coordinates[i++] = geomObj.getCoordinates()[0][5];
coordinates[i++] = geomObj.getCoordinates()[0][0];
coordinates[i++] = geomObj.getCoordinates()[0][4];
coordinates[i++] = geomObj.getCoordinates()[0][5];
coordinates[i++] = geomObj.getCoordinates()[0][0];
coordinates[i++] = geomObj.getCoordinates()[0][1];
coordinates[i++] = geomObj.getCoordinates()[0][2];
} else {
coordinates[i++] = geomObj.getCoordinates()[0][0];
coordinates[i++] = geomObj.getCoordinates()[0][1];
coordinates[i++] = geomObj.getCoordinates()[0][2];
coordinates[i++] = geomObj.getCoordinates()[0][1];
coordinates[i++] = geomObj.getCoordinates()[0][2];
coordinates[i++] = geomObj.getCoordinates()[0][3];
coordinates[i++] = geomObj.getCoordinates()[0][0];
coordinates[i++] = geomObj.getCoordinates()[0][3];
coordinates[i++] = geomObj.getCoordinates()[0][0];
coordinates[i++] = geomObj.getCoordinates()[0][1];
}
return JGeometry.createLinearPolygon(coordinates, geomObj.getDimension(), geomObj.getSrid());
}