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


Java MultiPath类代码示例

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


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

示例1: pop

import com.esri.core.geometry.MultiPath; //导入依赖的package包/类
/**
 * pop the first multipath in the collection, null if none
 */
public static MultiPathAndRole pop(List<MultiPathAndRole> l) {
	if (l == null)
		return null;

	boolean finished = false;
	MultiPathAndRole e = null;
	while (!finished) {
		if (l.size() == 0)
			return null;

		e = l.get(0);
		l.remove(0);

		MultiPath m = e.getMultiPath();
		if (m != null && !m.isEmpty()) {
			finished = true;
		}
	}

	return e;
}
 
开发者ID:frett27,项目名称:osm-flink-tools,代码行数:25,代码来源:PolygonCreator.java

示例2: firstAndLastPoints

import com.esri.core.geometry.MultiPath; //导入依赖的package包/类
static StringBuffer firstAndLastPoints(String role, MultiPath multiPath) {
	StringBuffer sb = new StringBuffer();
	if (role != null) {
		sb.append("(")

		.append(role).append(")");
	}

	sb.append(" ")
			.append(multiPath.getPointCount())
			.append(" pts -> ")
			.append(GeometryEngine.geometryToJson(4623,
					multiPath.getPoint(multiPath.getPathStart(0))));
	sb.append(" - ").append(
			GeometryEngine.geometryToJson(4623,
					multiPath.getPoint(multiPath.getPathEnd(0) - 1)));
	return sb;
}
 
开发者ID:frett27,项目名称:osm-flink-tools,代码行数:19,代码来源:PolygonCreator.java

示例3: getEveryNthPointFromThisMultiPath

import com.esri.core.geometry.MultiPath; //导入依赖的package包/类
float[] getEveryNthPointFromThisMultiPath(MultiPath arcMultiPathParam, int everyNpoints) {
    int arcPointCount = arcMultiPathParam.getPointCount();
    Log.e("arcadiusDebug", "arcPointCount: " + arcPointCount);

    ArrayList<Float> newSmallerArrayToReturn = new ArrayList<Float>();

    for (int i = 0; i < arcMultiPathParam.getPointCount(); i += everyNpoints) {
        newSmallerArrayToReturn.add((float) arcMultiPathParam.getPoint(i).getX());
        newSmallerArrayToReturn.add((float) arcMultiPathParam.getPoint(i).getZ());
        newSmallerArrayToReturn.add((float) arcMultiPathParam.getPoint(i).getY());
    }

    float[] simpleArray = new float[newSmallerArrayToReturn.size()];

    for(int i = 0; i < newSmallerArrayToReturn.size(); i++) {
        simpleArray[i] = newSmallerArrayToReturn.get(i).floatValue();
    }

    Log.e("arcadiusDebug", "Big array points: " + arcMultiPathParam.getPointCount());
    Log.e("arcadiusDebug", "Small array points: " + simpleArray.length);
    return simpleArray;
}
 
开发者ID:skylight1,项目名称:VR-Map-Explorer,代码行数:23,代码来源:MainActivity.java

示例4: main

import com.esri.core.geometry.MultiPath; //导入依赖的package包/类
public static void main(String[] args) throws IOException {
	byte[] bytes = Files.readAllBytes(Paths.get(args[0]));
	String text = new String(bytes, "US-ASCII");
	Geometry g = OperatorImportFromWkt.local().execute(0, Geometry.Type.Unknown, text, null);
	System.out.println(args[0] + " : " + g.getType() + 
			" " + ((MultiPath)g).getPathCount() + " rings" + " " + ((MultiPath)g).getPointCount() + " vertices");
	System.out.print("Checking if simple... ");
	boolean isSimple = OperatorSimplifyOGC.local().isSimpleOGC(g,  null,  true, null, null);
	System.out.println(isSimple);
	System.out.print("Running simplify operation... ");
	Geometry gSimple = OperatorSimplifyOGC.local().execute(g, null, true, null);
	System.out.println("Simple" + " : " + g.getType() + 
			" " + ((MultiPath)gSimple).getPathCount() + " rings" + " " + ((MultiPath)gSimple).getPointCount() + " vertices");
	System.out.println("Done");
	System.out.print("Running simplify operation (should be simple now)... ");
	isSimple = OperatorSimplifyOGC.local().isSimpleOGC(gSimple,  null,  true, null, null);
	System.out.println(isSimple);
}
 
开发者ID:Esri,项目名称:samples-geometry-api-java,代码行数:19,代码来源:OperatorSimplifyOGCTest.java

示例5: create

import com.esri.core.geometry.MultiPath; //导入依赖的package包/类
/**
 * convert the two arrays in one object list
 * 
 * @param multiPath
 * @param roles
 * @return
 */
private static List<MultiPathAndRole> create(MultiPath[] multiPath,
		Role[] roles) {

	assert multiPath != null;
	assert roles != null;
	assert multiPath.length == roles.length;

	List<MultiPathAndRole> pathLeft = new ArrayList<>();
	for (int i = 0; i < multiPath.length; i++) {
		pathLeft.add(new MultiPathAndRole(multiPath[i], roles[i]));
	}
	return pathLeft;
}
 
开发者ID:frett27,项目名称:osm-flink-tools,代码行数:21,代码来源:PolygonCreator.java

示例6: isClosed

import com.esri.core.geometry.MultiPath; //导入依赖的package包/类
public static boolean isClosed(MultiPath p) {
	assert p != null;
	int start = p.getPathStart(0);
	int end = p.getPathEnd(0) - 1;

	return areCoincident(p.getPoint(start), p.getPoint(end));

}
 
开发者ID:frett27,项目名称:osm-flink-tools,代码行数:9,代码来源:PolygonCreator.java

示例7: 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;
	}

}
 
开发者ID:Esri,项目名称:spatial-framework-for-hadoop,代码行数:39,代码来源:ST_IsClosed.java

示例8: evaluate

import com.esri.core.geometry.MultiPath; //导入依赖的package包/类
public IntWritable 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;
	}

	Geometry esriGeom = ogcGeometry.getEsriGeometry();
	switch(esriGeom.getType()) {
	case Point:
		resultInt.set(esriGeom.isEmpty() ? 0 : 1);
		break;
	case MultiPoint:
		resultInt.set(((MultiPoint)(esriGeom)).getPointCount());
		break;
	case Polygon:
		Polygon polygon = (Polygon)(esriGeom);
	    resultInt.set(polygon.getPointCount() + polygon.getPathCount());
		break;
	default:
		resultInt.set(((MultiPath)(esriGeom)).getPointCount());
		break;
	}
	return resultInt;
}
 
开发者ID:Esri,项目名称:spatial-framework-for-hadoop,代码行数:31,代码来源:ST_NumPoints.java

示例9: evaluate

import com.esri.core.geometry.MultiPath; //导入依赖的package包/类
/**
 * Return the last point of the ST_Linestring.
 * @param geomref hive geometry bytes
 * @return byte-reference of the last ST_Point
 */
public BytesWritable 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;
	}

	if (GeometryUtils.getType(geomref) == GeometryUtils.OGCType.ST_LINESTRING) {
		MultiPath lines = (MultiPath)(ogcGeometry.getEsriGeometry());
		int wkid = GeometryUtils.getWKID(geomref);
		SpatialReference spatialReference = null;
		if (wkid != GeometryUtils.WKID_UNKNOWN) {
			spatialReference = SpatialReference.create(wkid);
		}
		return GeometryUtils.geometryToEsriShapeBytesWritable(OGCGeometry.createFromEsriGeometry(lines.getPoint(lines.getPointCount()-1),
																								 spatialReference));
	} else {
		LogUtils.Log_InvalidType(LOG, GeometryUtils.OGCType.ST_LINESTRING, GeometryUtils.getType(geomref));
		return null;
	}
}
 
开发者ID:Esri,项目名称:spatial-framework-for-hadoop,代码行数:32,代码来源:ST_EndPoint.java

示例10: evaluate

import com.esri.core.geometry.MultiPath; //导入依赖的package包/类
/**
 * Return the first point of the ST_Linestring.
 * @param geomref hive geometry bytes
 * @return byte-reference of the first ST_Point
 */
public BytesWritable 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;
	}

	if (GeometryUtils.getType(geomref) == GeometryUtils.OGCType.ST_LINESTRING) {
		MultiPath lines = (MultiPath)(ogcGeometry.getEsriGeometry());
		int wkid = GeometryUtils.getWKID(geomref);
		SpatialReference spatialReference = null;
		if (wkid != GeometryUtils.WKID_UNKNOWN) {
			spatialReference = SpatialReference.create(wkid);
		}
		return GeometryUtils.geometryToEsriShapeBytesWritable(OGCGeometry.createFromEsriGeometry(lines.getPoint(0),
																								 spatialReference));
	} else {
		LogUtils.Log_InvalidType(LOG, GeometryUtils.OGCType.ST_LINESTRING, GeometryUtils.getType(geomref));
		return null;
	}
}
 
开发者ID:Esri,项目名称:spatial-framework-for-hadoop,代码行数:32,代码来源:ST_StartPoint.java

示例11: 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;
}
 
开发者ID:Esri,项目名称:geometry-api-java,代码行数:10,代码来源:OGCMultiCurve.java

示例12: OGCLineString

import com.esri.core.geometry.MultiPath; //导入依赖的package包/类
public OGCLineString(MultiPath mp, int pathIndex, SpatialReference sr,
		boolean reversed) {
	multiPath = new Polyline();
	if (!mp.isEmpty())
		multiPath.addPath(mp, pathIndex, !reversed);
	esriSR = sr;
}
 
开发者ID:Esri,项目名称:geometry-api-java,代码行数:8,代码来源:OGCLineString.java

示例13: MultiPathAndRole

import com.esri.core.geometry.MultiPath; //导入依赖的package包/类
public MultiPathAndRole(MultiPath p, Role r) {
	this.multiPath = p;
	this.role = r;
}
 
开发者ID:frett27,项目名称:osm-flink-tools,代码行数:5,代码来源:MultiPathAndRole.java

示例14: getMultiPath

import com.esri.core.geometry.MultiPath; //导入依赖的package包/类
public MultiPath getMultiPath() {
	return multiPath;
}
 
开发者ID:frett27,项目名称:osm-flink-tools,代码行数:4,代码来源:MultiPathAndRole.java

示例15: dump

import com.esri.core.geometry.MultiPath; //导入依赖的package包/类
public static void dump(MultiPath p) {
	assert p != null;
	String jsong = GeometryEngine.geometryToJson(4623, p);
	System.out.println(jsong);
}
 
开发者ID:frett27,项目名称:osm-flink-tools,代码行数:6,代码来源:PolygonCreator.java


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