• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java JGeometry类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中oracle.spatial.geometry.JGeometry的典型用法代码示例。如果您正苦于以下问题:Java JGeometry类的具体用法?Java JGeometry怎么用?Java JGeometry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



JGeometry类属于oracle.spatial.geometry包,在下文中一共展示了JGeometry类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getMultiPoint

import oracle.spatial.geometry.JGeometry; //导入依赖的package包/类
@Override
public GeometryObject getMultiPoint(Object geomObj) throws SQLException {
	if (geomObj instanceof Struct)
		return getMultiPoint(JGeometry.loadJS((Struct)geomObj));

	return null;
}
 
开发者ID:3dcitydb,项目名称:importer-exporter,代码行数:8,代码来源:GeometryConverterAdapter.java


示例2: getCurve

import oracle.spatial.geometry.JGeometry; //导入依赖的package包/类
@Override
public GeometryObject getCurve(Object geomObj) throws SQLException {
	if (geomObj instanceof Struct)
		return getCurve(JGeometry.loadJS((Struct)geomObj));

	return null;
}
 
开发者ID:3dcitydb,项目名称:importer-exporter,代码行数:8,代码来源:GeometryConverterAdapter.java


示例3: getMultiCurve

import oracle.spatial.geometry.JGeometry; //导入依赖的package包/类
@Override
public GeometryObject getMultiCurve(Object geomObj) throws SQLException {
	if (geomObj instanceof Struct)
		return getMultiCurve(JGeometry.loadJS((Struct)geomObj));

	return null;
}
 
开发者ID:3dcitydb,项目名称:importer-exporter,代码行数:8,代码来源:GeometryConverterAdapter.java


示例4: getMultiPolygon

import oracle.spatial.geometry.JGeometry; //导入依赖的package包/类
@Override
public GeometryObject getMultiPolygon(Object geomObj) throws SQLException {
	if (geomObj instanceof Struct)
		return getMultiPolygon(JGeometry.loadJS((Struct)geomObj));

	return null;
}
 
开发者ID:3dcitydb,项目名称:importer-exporter,代码行数:8,代码来源:GeometryConverterAdapter.java


示例5: BuildingNode

import oracle.spatial.geometry.JGeometry; //导入依赖的package包/类
public BuildingNode() {
	lodGeometryId = new long[4];
	terrainIntersection = new JGeometry[4];
	multiCurve = new JGeometry[3];
	addressProperty = new ArrayList<AddressProperty>();
	childNodes = new ArrayList<BuildingNode>();
}
 
开发者ID:3dcitydb,项目名称:importer-exporter-oracle,代码行数:8,代码来源:DBBuilding.java


示例6: getPointProperty

import oracle.spatial.geometry.JGeometry; //导入依赖的package包/类
public PointProperty getPointProperty(JGeometry geom, boolean setSrsName) {
	PointProperty pointProperty = null;

	Point point = getPoint(geom, setSrsName);
	if (point != null) {
		pointProperty = new PointPropertyImpl();
		pointProperty.setPoint(point);
	}

	return pointProperty;
}
 
开发者ID:3dcitydb,项目名称:importer-exporter-oracle,代码行数:12,代码来源:DBSdoGeometry.java


示例7: getMultiPointProperty

import oracle.spatial.geometry.JGeometry; //导入依赖的package包/类
public MultiPointProperty getMultiPointProperty(JGeometry geom, boolean setSrsName) {
	MultiPointProperty multiPointProperty = null;

	MultiPoint multiPoint = getMultiPoint(geom, setSrsName);
	if (multiPoint != null) {
		multiPointProperty = new MultiPointPropertyImpl();
		multiPointProperty.setMultiPoint(multiPoint);
	}

	return multiPointProperty;
}
 
开发者ID:3dcitydb,项目名称:importer-exporter-oracle,代码行数:12,代码来源:DBSdoGeometry.java


示例8: getPoint

import oracle.spatial.geometry.JGeometry; //导入依赖的package包/类
@Override
public GeometryObject getPoint(Object geomObj) throws SQLException {
	if (geomObj instanceof Struct)
		return getPoint(JGeometry.loadJS((Struct)geomObj));

	return null;
}
 
开发者ID:3dcitydb,项目名称:importer-exporter,代码行数:8,代码来源:GeometryConverterAdapter.java


示例9: getPolygon

import oracle.spatial.geometry.JGeometry; //导入依赖的package包/类
@Override
public GeometryObject getPolygon(Object geomObj) throws SQLException {
	if (geomObj instanceof Struct)
		return getPolygon(JGeometry.loadJS((Struct)geomObj));

	return null;
}
 
开发者ID:3dcitydb,项目名称:importer-exporter,代码行数:8,代码来源:GeometryConverterAdapter.java


示例10: convertMultiPointToJGeometry

import oracle.spatial.geometry.JGeometry; //导入依赖的package包/类
private JGeometry convertMultiPointToJGeometry(GeometryObject geomObj) {
	Object[] objectArray = new Object[geomObj.getNumElements()];
	for (int i = 0; i < geomObj.getNumElements(); i++)
		objectArray[i] = geomObj.getCoordinates(i);

	return JGeometry.createMultiPoint(objectArray, geomObj.getDimension(), geomObj.getSrid());
}
 
开发者ID:3dcitydb,项目名称:importer-exporter,代码行数:8,代码来源:GeometryConverterAdapter.java


示例11: convertMultiCurveToJGeometry

import oracle.spatial.geometry.JGeometry; //导入依赖的package包/类
private JGeometry convertMultiCurveToJGeometry(GeometryObject geomObj) {
	Object[] objectArray = new Object[geomObj.getNumElements()];
	for (int i = 0; i < geomObj.getNumElements(); i++)
		objectArray[i] = geomObj.getCoordinates(i);

	return JGeometry.createLinearMultiLineString(objectArray, geomObj.getDimension(), geomObj.getSrid());
}
 
开发者ID:3dcitydb,项目名称:importer-exporter,代码行数:8,代码来源:GeometryConverterAdapter.java


示例12: 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


示例13: getPointOrCurveGeometryProperty

import oracle.spatial.geometry.JGeometry; //导入依赖的package包/类
public GeometryProperty<? extends AbstractGeometry> getPointOrCurveGeometryProperty(JGeometry geom, boolean setSrsName) {
	GeometryProperty<AbstractGeometry> geometryProperty = null;
	
	AbstractGeometry geometry = getPointOrCurveGeometry(geom, setSrsName);
	if (geometry != null) {
		geometryProperty = new GeometryPropertyImpl<AbstractGeometry>();
		geometryProperty.setGeometry(geometry);
	}
	
	return geometryProperty;
}
 
开发者ID:3dcitydb,项目名称:importer-exporter-oracle,代码行数:12,代码来源:DBSdoGeometry.java


示例14: getPolygonProperty

import oracle.spatial.geometry.JGeometry; //导入依赖的package包/类
public PolygonProperty getPolygonProperty(JGeometry geom, boolean setSrsName) {
	PolygonProperty polygonProperty = null;

	Polygon polygon = getPolygon(geom, setSrsName);
	if (polygon != null && (polygon.isSetExterior() || polygon.isSetInterior())) {
		polygonProperty = new PolygonPropertyImpl();
		polygonProperty.setPolygon(polygon);
	}

	return polygonProperty;
}
 
开发者ID:3dcitydb,项目名称:importer-exporter-oracle,代码行数:12,代码来源:DBSdoGeometry.java


示例15: convertToJTSGeometry

import oracle.spatial.geometry.JGeometry; //导入依赖的package包/类
public Geometry convertToJTSGeometry(ValueMetaInterface vmi, Object obj, Database db) {
	if (obj instanceof oracle.sql.STRUCT) {
		try {
			// Map Oracle's SRID with the EPSG-SRID or take a custom SRS from WKT
			int oracle_srid = JGeometry.load((STRUCT)obj).getSRID();
			// see bug 2845785; disabled reading of SRS metadata as temporary workaround,
			// meanwhile one must assign SRS manually using Set SRS step
			// TODO: review everything!
			// SRS epsg_srid = convertToEPSG_SRID(oracle_srid, db.getConnection());
			SRS epsg_srid = SRS.UNKNOWN;
			vmi.setGeometrySRS(epsg_srid);
			
			WKB wkb = new WKB(ByteOrder.BIG_ENDIAN);		// Create empty WKB representation
			byte[] b = wkb.fromSTRUCT( (STRUCT) obj );		// convert: Object -> STRUCT -> byte[]
			Geometry jtsGeom = (new WKBReader()).read(b);	// convert: byte[] -> JTS-Geometry
			jtsGeom.setSRID(epsg_srid.getSRID());			// set the SRID of the JTS-Geometry
			return jtsGeom;
		} catch (Exception e) {
			LOGGER.logError("GeoKettle", "Conversion from Oracle-geometry failed.");
			return null;
		}
	} else {
		LOGGER.logDetailed("GeoKettle", "No Oracle-geometry found to convert.");
		return null;
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:27,代码来源:OracleDatabaseMeta.java


示例16: convertToObject

import oracle.spatial.geometry.JGeometry; //导入依赖的package包/类
public Object convertToObject(ValueMetaInterface vmi, Geometry jtsGeom, Database db) {
	WKBWriter wkbWriter = new WKBWriter();
	byte[] b = wkbWriter.write(jtsGeom);
	WKB wkb = new WKB(ByteOrder.BIG_ENDIAN);
	try {
		// Map the EPSG- (or custom-) SRID with Oracle's SRID.
		// TODO: review this, probably has some of the same issues as when reading the SRID
		int oracle_srid = convertToDBMS_SRID(vmi.getGeometrySRS(), db.getConnection());
		
		STRUCT oracleStruct = wkb.toSTRUCT(b, db.getConnection());			// convert: byte[] --> STRUCT (using DB connection)
		JGeometry oracleGeom = JGeometry.load(oracleStruct);				// convert: STRUCT --> JGeometry
		oracleGeom.setSRID(oracle_srid);									// set the SRID
		oracleStruct = JGeometry.store(db.getConnection(), oracleGeom);		// convert: JGeometry --> STRUCT (using DB connection)
		return oracleStruct;
	} catch (Exception e) {
		LOGGER.logError("GeoKettle", "Conversion to Oracle-geometry failed.");
		return null;
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:20,代码来源:OracleDatabaseMeta.java


示例17: getEnvelope

import oracle.spatial.geometry.JGeometry; //导入依赖的package包/类
@Override
public GeometryObject getEnvelope(Object geomObj) throws SQLException {
	GeometryObject envelope = null;

	if (geomObj instanceof Struct) {
		JGeometry geometry = JGeometry.loadJS((Struct)geomObj);
		double[] ordinates = geometry.getMBR();
		double[] coordinates;

		if (geometry.getDimensions() == 3)
			coordinates = new double[]{ordinates[0], ordinates[1], ordinates[2], ordinates[3], ordinates[4], ordinates[5]};
		else 
			coordinates = new double[]{ordinates[0], ordinates[1], 0, ordinates[2], ordinates[3], 0};

		envelope = GeometryObject.createEnvelope(coordinates, 3, geometry.getSRID());
	}

	return envelope;
}
 
开发者ID:3dcitydb,项目名称:importer-exporter,代码行数:20,代码来源:GeometryConverterAdapter.java


示例18: getPolygonCoordinates

import oracle.spatial.geometry.JGeometry; //导入依赖的package包/类
private double[][] getPolygonCoordinates(JGeometry geometry) {
	int[] elemInfo = geometry.getElemInfo();
	double[] ordinates = geometry.getOrdinatesArray();
	if (elemInfo.length < 3)
		return null;

	int[] ringLimits = new int[elemInfo.length / 3];
	ringLimits[ringLimits.length - 1] = ordinates.length;
	for (int i = 3, j = 0; i < elemInfo.length; i += 3, j++)
		ringLimits[j] = elemInfo[i] - 1;

	double[][] coordinates = new double[ringLimits.length][];			
	for (int i = 0, ordinate = 0; i < ringLimits.length; i++) {
		coordinates[i] = new double[ringLimits[i] - ordinate];
		for (int j = 0; ordinate < ringLimits[i]; ordinate++, j++)
			coordinates[i][j] = ordinates[ordinate];
	}
	
	return coordinates;
}
 
开发者ID:3dcitydb,项目名称:importer-exporter,代码行数:21,代码来源:GeometryConverterAdapter.java


示例19: getGeometry

import oracle.spatial.geometry.JGeometry; //导入依赖的package包/类
@Override
public GeometryObject getGeometry(Object geomObj) throws SQLException {
	if (geomObj instanceof Struct) {
		JGeometry geometry = JGeometry.loadJS((Struct)geomObj);
		switch (geometry.getType()) {
		case JGeometry.GTYPE_POINT:
			return getPoint(geometry);
		case JGeometry.GTYPE_MULTIPOINT:
			return getMultiPoint(geometry);
		case JGeometry.GTYPE_CURVE:
			return getCurve(geometry);
		case JGeometry.GTYPE_MULTICURVE:
			return getMultiCurve(geometry);
		case JGeometry.GTYPE_POLYGON:
			return getPolygon(geometry);
		case JGeometry.GTYPE_MULTIPOLYGON:
			return getMultiPolygon(geometry);
		default:
			throw new SQLException("Cannot convert Oracle geometry type '" + geometry.getType() + "' to internal representation: Unsupported type.");
		}
	}

	return null;
}
 
开发者ID:3dcitydb,项目名称:importer-exporter,代码行数:25,代码来源:GeometryConverterAdapter.java


示例20: convertMultiPolygonToJGeometry

import oracle.spatial.geometry.JGeometry; //导入依赖的package包/类
private JGeometry convertMultiPolygonToJGeometry(GeometryObject geomObj) {
	int[] elemInfo = new int[geomObj.getNumElements() * 3];
	double[] ordinates = new double[geomObj.getNumCoordinates()];
	
	int ordinatesIndex = 0;
	int elemInfoIndex = 0;
	
	for (int i = 0; i < geomObj.getNumElements(); i++) {			
		elemInfo[elemInfoIndex++] = ordinatesIndex + 1;
		elemInfo[elemInfoIndex++] = geomObj.getElementType(i) == ElementType.EXTERIOR_LINEAR_RING ? 1003 : 2003;
		elemInfo[elemInfoIndex++] = 1;
		
		double[] coordinates = geomObj.getCoordinates(i);
		for (int j = 0; j < coordinates.length; j++)
			ordinates[ordinatesIndex++] = coordinates[j];
	}
	
	return new JGeometry(JGeometry.GTYPE_MULTIPOLYGON, geomObj.getSrid(), elemInfo, ordinates);
}
 
开发者ID:3dcitydb,项目名称:importer-exporter,代码行数:20,代码来源:GeometryConverterAdapter.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AbstractCheckedFuture类代码示例发布时间:2022-05-22
下一篇:
Java PojoObservables类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap