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

Java MultiPath类代码示例

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

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



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


示例16: loadElements

import com.esri.core.geometry.MultiPath; //导入依赖的package包/类
public ArrayList<MultiPathAndRole> loadElements(int i) throws Exception {

		File f = new File(storefolder, "test_file_" + i);
		FileReader fr = new FileReader(f);
		try {
			JSONObject jo = new JSONObject(new JSONTokener(fr));
			JSONArray origin = jo.getJSONArray("origin");
			ArrayList<MultiPathAndRole> m = new ArrayList<MultiPathAndRole>(origin.length());
			for (int j = 0; j < origin.length(); j++) {

				JSONObject r = origin.getJSONObject(j);

				MapGeometry geometry = GeometryEngine.jsonToGeometry(r.getJSONObject("geometry").toString());

				m.add(new MultiPathAndRole((MultiPath) geometry.getGeometry(), Role.valueOf(r.getString("role"))));

			}

			return m;

		} finally {
			fr.close();
		}

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


示例17: onPostExecute

import com.esri.core.geometry.MultiPath; //导入依赖的package包/类
@Override
        protected void onPostExecute(FeatureResult results) {

            String message = "No result comes back";

            if (results != null) {
                int size = (int) results.featureCount();
                Log.e("arcadiusDebug", "Number of Polygons: " + size);

                smallerArray = new float[size][];

                int i = 0;
                for (Object element : results) {
                    overlayView.incrementProgressBy(size / 100);
                    if (element instanceof Feature) {
                        Feature feature = (Feature) element;
                        // turn feature into graphic\

                        Geometry arcGeometry = feature.getGeometry();
                        Geometry.Type arcType = arcGeometry.getType();

                        MultiPath arcMultiPath = (MultiPath) arcGeometry;

                        Graphic graphic = new Graphic(feature.getGeometry(),
                                feature.getSymbol(),
                                feature.getAttributes());

                        smallerArray[i++] = getEveryNthPointFromThisMultiPath(arcMultiPath, 100);
                    }
                }
                // update message with results
                message = String.valueOf(results.featureCount())
                        + " results have returned from query.";

                onGeometriesCreated();
            }
            overlayView.dismissProgressToast();

//            if(isVRMode) {
//                overlayView.show3DToast(message);
//            } else {
//                Toast.makeText(MainActivity.this, message, Toast.LENGTH_LONG).show();
//            }
        }
 
开发者ID:skylight1,项目名称:VR-Map-Explorer,代码行数:45,代码来源:MainActivity.java


示例18: 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;
}
 
开发者ID:Esri,项目名称:spatial-framework-for-hadoop,代码行数:46,代码来源:ST_GeodesicLengthWGS84.java


示例19: numGeometries

import com.esri.core.geometry.MultiPath; //导入依赖的package包/类
public int numGeometries() {
	MultiPath mp = (MultiPath) getEsriGeometry();
	return mp.getPathCount();
}
 
开发者ID:Esri,项目名称:geometry-api-java,代码行数:5,代码来源:OGCMultiCurve.java


示例20: OGCLinearRing

import com.esri.core.geometry.MultiPath; //导入依赖的package包/类
public OGCLinearRing(MultiPath mp, int pathIndex, SpatialReference sr,
		boolean reversed) {
	super(mp, pathIndex, sr, reversed);
	if (!mp.isClosedPath(0))
		throw new IllegalArgumentException("LinearRing path must be closed");
}
 
开发者ID:Esri,项目名称:geometry-api-java,代码行数:7,代码来源:OGCLinearRing.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java SVNStatusKind类代码示例发布时间:2022-05-22
下一篇:
Java RedisConnectionUtils类代码示例发布时间: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