本文整理汇总了Java中com.esri.core.geometry.MultiPath.getPathCount方法的典型用法代码示例。如果您正苦于以下问题:Java MultiPath.getPathCount方法的具体用法?Java MultiPath.getPathCount怎么用?Java MultiPath.getPathCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.esri.core.geometry.MultiPath
的用法示例。
在下文中一共展示了MultiPath.getPathCount方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: evaluate
import com.esri.core.geometry.MultiPath; //导入方法依赖的package包/类
public BooleanWritable evaluate(BytesWritable geomref) {
if (geomref == null || geomref.getLength() == 0) {
LogUtils.Log_ArgumentsNull(LOG);
return null;
}
OGCGeometry ogcGeometry = GeometryUtils.geometryFromEsriShape(geomref);
if (ogcGeometry == null){
LogUtils.Log_ArgumentsNull(LOG);
return null;
}
try {
switch(GeometryUtils.getType(geomref)) {
case ST_LINESTRING:
case ST_MULTILINESTRING:
MultiPath lines = (MultiPath)(ogcGeometry.getEsriGeometry());
int nPaths = lines.getPathCount();
boolean rslt = true;
for (int ix = 0; rslt && ix < nPaths; ix++) {
Point p0 = lines.getPoint(lines.getPathStart(ix));
Point pf = lines.getPoint(lines.getPathEnd(ix)-1);
rslt = rslt && pf.equals(p0); // no tolerance - OGC
}
resultBoolean.set(rslt);
return resultBoolean;
default: // ST_IsClosed gives ERROR on Point or Polygon, on Postgres/Oracle
LogUtils.Log_InvalidType(LOG, GeometryUtils.OGCType.ST_LINESTRING, GeometryUtils.getType(geomref));
return null;
}
} catch (Exception e) {
LogUtils.Log_InternalError(LOG, "ST_IsClosed" + e);
return null;
}
}
示例2: isClosed
import com.esri.core.geometry.MultiPath; //导入方法依赖的package包/类
public boolean isClosed() {
MultiPath mp = (MultiPath) getEsriGeometry();
for (int i = 0, n = mp.getPathCount(); i < n; i++) {
if (!mp.isClosedPathInXYPlane(i))
return false;
}
return true;
}
示例3: evaluate
import com.esri.core.geometry.MultiPath; //导入方法依赖的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;
}
示例4: numGeometries
import com.esri.core.geometry.MultiPath; //导入方法依赖的package包/类
public int numGeometries() {
MultiPath mp = (MultiPath) getEsriGeometry();
return mp.getPathCount();
}