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


Java GeometryEngine.geodesicDistanceOnWGS84方法代码示例

本文整理汇总了Java中com.esri.core.geometry.GeometryEngine.geodesicDistanceOnWGS84方法的典型用法代码示例。如果您正苦于以下问题:Java GeometryEngine.geodesicDistanceOnWGS84方法的具体用法?Java GeometryEngine.geodesicDistanceOnWGS84怎么用?Java GeometryEngine.geodesicDistanceOnWGS84使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.esri.core.geometry.GeometryEngine的用法示例。


在下文中一共展示了GeometryEngine.geodesicDistanceOnWGS84方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: hasGeometryMoved

import com.esri.core.geometry.GeometryEngine; //导入方法依赖的package包/类
private boolean hasGeometryMoved(MapGeometry geom1, MapGeometry geom2,
		double tolerance) {
	if (geom1 != null && geom1.getGeometry() != null
			&& geom1.getGeometry().getType() == Type.Point && geom2 != null
			&& geom2.getGeometry() != null
			&& geom2.getGeometry().getType() == Type.Point) {
		Point corePt1 = (Point) geom1.getGeometry();
		Point corePt2 = (Point) geom2.getGeometry();
		double meters = 0.0;
		try {
			meters = GeometryEngine.geodesicDistanceOnWGS84(corePt1,
					corePt2);
		} catch (Throwable error) {
			LOGGER.error(error.getMessage());
		}

		double feet = meter2feet(meters);
		if (feet >= tolerance)
			return true;
		else
			return false;
	} else {
		throw new RuntimeException(
				LOGGER.translate("INVALID_GEOMETRY_TYPE"));
	}
}
 
开发者ID:Esri,项目名称:defense-solutions-proofs-of-concept,代码行数:27,代码来源:TrackIdleProcessor.java

示例2: hasGeometryMoved

import com.esri.core.geometry.GeometryEngine; //导入方法依赖的package包/类
private boolean hasGeometryMoved(MapGeometry geom1, MapGeometry geom2, double tolerance)
{
	if (geom1 != null && geom1.getGeometry() != null && geom1.getGeometry().getType() == Type.Point && geom2 != null && geom2.getGeometry() != null && geom2.getGeometry().getType() == Type.Point)
	{
		Point corePt1 = (Point) geom1.getGeometry();
		Point corePt2 = (Point) geom2.getGeometry();
		double meters = 0.0;
		try
		{
			meters = GeometryEngine.geodesicDistanceOnWGS84(corePt1, corePt2);
		}
		catch (Throwable error)
		{
			LOGGER.error(error.getMessage());
		}

		double feet = meter2feet(meters);
		if (feet >= tolerance)
			return true;
		else
			return false;
	}
	else
	{
		throw new RuntimeException(LOGGER.translate("INVALID_GEOMETRY_TYPE"));
	}
}
 
开发者ID:Esri,项目名称:track-idle-detector-for-geoevent,代码行数:28,代码来源:TrackIdleDetector.java

示例3: distance

import com.esri.core.geometry.GeometryEngine; //导入方法依赖的package包/类
private static double distance(Point a, Point b) {
    return GeometryEngine.geodesicDistanceOnWGS84(a, b);
}
 
开发者ID:bmwcarit,项目名称:barefoot,代码行数:4,代码来源:GeographyTest.java

示例4: evaluate

import com.esri.core.geometry.GeometryEngine; //导入方法依赖的package包/类
public DoubleWritable evaluate(BytesWritable geomref) {
	if (geomref == null || geomref.getLength() == 0) {
		LogUtils.Log_ArgumentsNull(LOG);
		return null;
	}

	int WGS84 = 4326;
	if (GeometryUtils.getWKID(geomref) != WGS84) {
	    LogUtils.Log_SRIDMismatch(LOG, geomref, WGS84);
		return null;
	}

	OGCGeometry ogcGeometry = GeometryUtils.geometryFromEsriShape(geomref);
	if (ogcGeometry == null){
		LogUtils.Log_ArgumentsNull(LOG);
		return null;
	}

	Geometry esriGeom = ogcGeometry.getEsriGeometry();
	switch(esriGeom.getType()) {
	case Point:
	case MultiPoint:
		resultDouble.set(0.);
		break;
	default:
		MultiPath lines = (MultiPath)(esriGeom);
		int nPath = lines.getPathCount();
		double length = 0.;
		for (int ix = 0; ix < nPath; ix++) {
			int curPt = lines.getPathStart(ix);
			int pastPt = lines.getPathEnd(ix);
			Point fromPt = lines.getPoint(curPt);
			Point toPt = null;
			for (int vx = curPt+1; vx < pastPt; vx++) {
				toPt = lines.getPoint(vx);
				length += GeometryEngine.geodesicDistanceOnWGS84(fromPt, toPt);
				fromPt = toPt;
			}
		}
		resultDouble.set(length);
		break;
	}

	return resultDouble;
}
 
开发者ID:Esri,项目名称:spatial-framework-for-hadoop,代码行数:46,代码来源:ST_GeodesicLengthWGS84.java


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