当前位置: 首页>>代码示例>>Java>>正文


Java JGeometry.createLinearPolygon方法代码示例

本文整理汇总了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());
	} 
}
 
开发者ID:3dcitydb,项目名称:importer-exporter,代码行数:12,代码来源:GeometryConverterAdapter.java

示例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());
}
 
开发者ID:3dcitydb,项目名称:importer-exporter,代码行数:45,代码来源:GeometryConverterAdapter.java


注:本文中的oracle.spatial.geometry.JGeometry.createLinearPolygon方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。