本文整理汇总了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"));
}
}
示例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"));
}
}
示例3: distance
import com.esri.core.geometry.GeometryEngine; //导入方法依赖的package包/类
private static double distance(Point a, Point b) {
return GeometryEngine.geodesicDistanceOnWGS84(a, b);
}
示例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;
}