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

Java CompoundCurve类代码示例

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

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



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

示例1: convertCompoundCurve

import mil.nga.wkb.geom.CompoundCurve; //导入依赖的package包/类
/**
 * Test the CompoundCurve conversion
 * 
 * @param converter
 * @param compoundCurve
 */
private static void convertCompoundCurve(GoogleMapShapeConverter converter,
		CompoundCurve compoundCurve) {

	MultiPolylineOptions polylines = converter.toPolylines(compoundCurve);
	TestCase.assertNotNull(polylines);
	TestCase.assertFalse(polylines.getPolylineOptions().isEmpty());

	List<LineString> lineStrings = compoundCurve.getLineStrings();
	compareLineStringsAndPolylines(converter, lineStrings,
			polylines.getPolylineOptions());

	CompoundCurve compoundCurve2 = converter
			.toCompoundCurveWithOptions(polylines);
	compareLineStrings(lineStrings, compoundCurve2.getLineStrings());
}
 
开发者ID:ngageoint,项目名称:geopackage-android-map,代码行数:22,代码来源:GoogleMapShapeConverterUtils.java


示例2: toCompoundCurveFromList

import mil.nga.wkb.geom.CompoundCurve; //导入依赖的package包/类
/**
 * Convert a list of List<LatLng> to a {@link CompoundCurve}
 *
 * @param polylineList
 * @param hasZ
 * @param hasM
 * @return
 */
public CompoundCurve toCompoundCurveFromList(
        List<List<LatLng>> polylineList, boolean hasZ, boolean hasM) {

    CompoundCurve compoundCurve = new CompoundCurve(hasZ, hasM);

    for (List<LatLng> polyline : polylineList) {
        LineString lineString = toLineString(polyline);
        compoundCurve.addLineString(lineString);
    }

    return compoundCurve;
}
 
开发者ID:ngageoint,项目名称:geopackage-android-map,代码行数:21,代码来源:GoogleMapShapeConverter.java


示例3: toCompoundCurveFromOptions

import mil.nga.wkb.geom.CompoundCurve; //导入依赖的package包/类
/**
 * Convert a {@link MultiPolylineOptions} to a {@link CompoundCurve}
 *
 * @param multiPolylineOptions
 * @param hasZ
 * @param hasM
 * @return
 */
public CompoundCurve toCompoundCurveFromOptions(
        MultiPolylineOptions multiPolylineOptions, boolean hasZ,
        boolean hasM) {

    CompoundCurve compoundCurve = new CompoundCurve(hasZ, hasM);

    for (PolylineOptions polyline : multiPolylineOptions
            .getPolylineOptions()) {
        LineString lineString = toLineString(polyline);
        compoundCurve.addLineString(lineString);
    }

    return compoundCurve;
}
 
开发者ID:ngageoint,项目名称:geopackage-android-map,代码行数:23,代码来源:GoogleMapShapeConverter.java


示例4: toPolylines

import mil.nga.wkb.geom.CompoundCurve; //导入依赖的package包/类
/**
 * Convert a {@link CompoundCurve} to a {@link MultiPolylineOptions}
 *
 * @param compoundCurve
 * @return
 */
public MultiPolylineOptions toPolylines(CompoundCurve compoundCurve) {

    MultiPolylineOptions polylines = new MultiPolylineOptions();

    for (LineString lineString : compoundCurve.getLineStrings()) {
        PolylineOptions polyline = toPolyline(lineString);
        polylines.add(polyline);
    }

    return polylines;
}
 
开发者ID:ngageoint,项目名称:geopackage-android-map,代码行数:18,代码来源:GoogleMapShapeConverter.java


示例5: toCompoundCurve

import mil.nga.wkb.geom.CompoundCurve; //导入依赖的package包/类
/**
 * Convert a list of {@link Polyline} to a {@link CompoundCurve}
 *
 * @param polylineList
 * @param hasZ
 * @param hasM
 * @return
 */
public CompoundCurve toCompoundCurve(List<Polyline> polylineList,
                                     boolean hasZ, boolean hasM) {

    CompoundCurve compoundCurve = new CompoundCurve(hasZ, hasM);

    for (Polyline polyline : polylineList) {
        LineString lineString = toLineString(polyline);
        compoundCurve.addLineString(lineString);
    }

    return compoundCurve;
}
 
开发者ID:ngageoint,项目名称:geopackage-android-map,代码行数:21,代码来源:GoogleMapShapeConverter.java


示例6: toCompoundCurveWithOptions

import mil.nga.wkb.geom.CompoundCurve; //导入依赖的package包/类
/**
 * Convert a {@link MultiPolylineOptions} to a {@link CompoundCurve}
 *
 * @param multiPolylineOptions
 * @param hasZ
 * @param hasM
 * @return
 */
public CompoundCurve toCompoundCurveWithOptions(
        MultiPolylineOptions multiPolylineOptions, boolean hasZ,
        boolean hasM) {

    CompoundCurve compoundCurve = new CompoundCurve(hasZ, hasM);

    for (PolylineOptions polyline : multiPolylineOptions
            .getPolylineOptions()) {
        LineString lineString = toLineString(polyline);
        compoundCurve.addLineString(lineString);
    }

    return compoundCurve;
}
 
开发者ID:ngageoint,项目名称:geopackage-android-map,代码行数:23,代码来源:GoogleMapShapeConverter.java


示例7: compareCompoundCurve

import mil.nga.wkb.geom.CompoundCurve; //导入依赖的package包/类
/**
 * Compare the two compound curves for equality
 *
 * @param expected
 * @param actual
 * @parma delta
 */
private static void compareCompoundCurve(CompoundCurve expected,
										 CompoundCurve actual, double delta) {

	compareBaseGeometryAttributes(expected, actual);
	TestCase.assertEquals(expected.numLineStrings(),
			actual.numLineStrings());
	for (int i = 0; i < expected.numLineStrings(); i++) {
		compareLineString(expected.getLineStrings().get(i), actual
				.getLineStrings().get(i), delta);
	}
}
 
开发者ID:ngageoint,项目名称:geopackage-android,代码行数:19,代码来源:GeoPackageGeometryDataUtils.java


示例8: transform

import mil.nga.wkb.geom.CompoundCurve; //导入依赖的package包/类
/**
 * Transform the projected compound curve
 * 
 * @param compoundCurve
 * @return projected compound curve
 */
public CompoundCurve transform(CompoundCurve compoundCurve) {

	CompoundCurve to = new CompoundCurve(compoundCurve.hasZ(),
			compoundCurve.hasM());

	for (LineString lineString : compoundCurve.getLineStrings()) {
		LineString toLineString = transform(lineString);
		to.addLineString(toLineString);
	}

	return to;
}
 
开发者ID:ngageoint,项目名称:geopackage-core-java,代码行数:19,代码来源:GeometryProjectionTransform.java


示例9: compareCompoundCurve

import mil.nga.wkb.geom.CompoundCurve; //导入依赖的package包/类
/**
 * Compare the two compound curves for equality
 * 
 * @param expected
 * @param actual
 * @parma delta
 */
private static void compareCompoundCurve(CompoundCurve expected,
		CompoundCurve actual, double delta) {

	compareBaseGeometryAttributes(expected, actual);
	TestCase.assertEquals(expected.numLineStrings(),
			actual.numLineStrings());
	for (int i = 0; i < expected.numLineStrings(); i++) {
		compareLineString(expected.getLineStrings().get(i), actual
				.getLineStrings().get(i), delta);
	}
}
 
开发者ID:ngageoint,项目名称:geopackage-java,代码行数:19,代码来源:GeoPackageGeometryDataUtils.java


示例10: addCompoundCurveMessage

import mil.nga.wkb.geom.CompoundCurve; //导入依赖的package包/类
/**
 * Add CompoundCurve
 * 
 * @param envelope
 * @param compoundCurve
 */
private static void addCompoundCurveMessage(GeometryEnvelope envelope,
		CompoundCurve compoundCurve) {

	updateHasZandM(envelope, compoundCurve);

	List<LineString> lineStrings = compoundCurve.getLineStrings();
	for (LineString lineString : lineStrings) {
		addLineStringMessage(envelope, lineString);
	}
}
 
开发者ID:ngageoint,项目名称:geopackage-wkb-java,代码行数:17,代码来源:GeometryEnvelopeBuilder.java


示例11: add

import mil.nga.wkb.geom.CompoundCurve; //导入依赖的package包/类
/**
 * Add a curve based dimension 1 geometry to the centroid total. Ignores
 * dimension 0 geometries.
 * 
 * @param geometry
 *            geometry
 */
public void add(Geometry geometry) {

	GeometryType geometryType = geometry.getGeometryType();
	switch (geometryType) {
	case LINESTRING:
	case CIRCULARSTRING:
		add((LineString) geometry);
		break;
	case MULTILINESTRING:
		MultiLineString multiLineString = (MultiLineString) geometry;
		addLineStrings(multiLineString.getLineStrings());
		break;
	case COMPOUNDCURVE:
		CompoundCurve compoundCurve = (CompoundCurve) geometry;
		addLineStrings(compoundCurve.getLineStrings());
		break;
	case GEOMETRYCOLLECTION:
		@SuppressWarnings("unchecked")
		GeometryCollection<Geometry> geomCollection = (GeometryCollection<Geometry>) geometry;
		List<Geometry> geometries = geomCollection.getGeometries();
		for (Geometry subGeometry : geometries) {
			add(subGeometry);
		}
		break;
	case POINT:
	case MULTIPOINT:
		// Doesn't contribute to curve dimension
		break;
	default:
		throw new WkbException("Unsupported "
				+ this.getClass().getSimpleName() + " Geometry Type: "
				+ geometryType);
	}
}
 
开发者ID:ngageoint,项目名称:geopackage-wkb-java,代码行数:42,代码来源:CentroidCurve.java


示例12: addCompoundCurveMessage

import mil.nga.wkb.geom.CompoundCurve; //导入依赖的package包/类
/**
 * Add CompoundCurve message
 * 
 * @param message
 * @param compoundCurve
 */
private static void addCompoundCurveMessage(StringBuilder message,
		CompoundCurve compoundCurve) {
	message.append(LineString.class.getSimpleName() + "s: "
			+ compoundCurve.numLineStrings());
	List<LineString> lineStrings = compoundCurve.getLineStrings();
	for (int i = 0; i < lineStrings.size(); i++) {
		LineString lineString = lineStrings.get(i);
		message.append("\n\n");
		message.append(LineString.class.getSimpleName() + " " + (i + 1));
		message.append("\n");
		addLineStringMessage(message, lineString);
	}
}
 
开发者ID:ngageoint,项目名称:geopackage-wkb-java,代码行数:20,代码来源:GeometryPrinter.java


示例13: getCompoundCurve

import mil.nga.wkb.geom.CompoundCurve; //导入依赖的package包/类
/**
 * Get CompoundCurve object
 * 
 * @param compoundCurve
 * @return compound curve object
 */
private static Object getCompoundCurve(CompoundCurve compoundCurve) {
	List<Object> jsonObject = new ArrayList<>();
	List<LineString> lineStrings = compoundCurve.getLineStrings();
	for (int i = 0; i < lineStrings.size(); i++) {
		LineString lineString = lineStrings.get(i);
		jsonObject.add(getLineString(lineString));
	}
	return jsonObject;
}
 
开发者ID:ngageoint,项目名称:geopackage-wkb-java,代码行数:16,代码来源:GeometryJSONCompatible.java


示例14: writeCompoundCurve

import mil.nga.wkb.geom.CompoundCurve; //导入依赖的package包/类
/**
 * Write a Compound Curve
 * 
 * @param writer
 * @param compoundCurve
 * @throws IOException
 */
public static void writeCompoundCurve(ByteWriter writer,
		CompoundCurve compoundCurve) throws IOException {

	writer.writeInt(compoundCurve.numLineStrings());

	for (LineString lineString : compoundCurve.getLineStrings()) {
		writeGeometry(writer, lineString);
	}
}
 
开发者ID:ngageoint,项目名称:geopackage-wkb-java,代码行数:17,代码来源:WkbGeometryWriter.java


示例15: compareCompoundCurve

import mil.nga.wkb.geom.CompoundCurve; //导入依赖的package包/类
/**
 * Compare the two compound curves for equality
 * 
 * @param expected
 * @param actual
 */
public static void compareCompoundCurve(CompoundCurve expected,
		CompoundCurve actual) {

	compareBaseGeometryAttributes(expected, actual);
	TestCase.assertEquals(expected.numLineStrings(),
			actual.numLineStrings());
	for (int i = 0; i < expected.numLineStrings(); i++) {
		compareLineString(expected.getLineStrings().get(i), actual
				.getLineStrings().get(i));
	}
}
 
开发者ID:ngageoint,项目名称:geopackage-wkb-java,代码行数:18,代码来源:WKBTestUtils.java


示例16: toPolylines

import mil.nga.wkb.geom.CompoundCurve; //导入依赖的package包/类
/**
 * Convert a {@link CompoundCurve} to a {@link MultiPolylineOptions}
 *
 * @param compoundCurve
 * @return
 */
public List<Polyline> toPolylines(CompoundCurve compoundCurve) {

    List<Polyline> lines = new ArrayList<>();
    MultiPolylineOptions polylines = new MultiPolylineOptions();

    for (LineString lineString : compoundCurve.getLineStrings()) {
        Polyline polyline = toPolyline(lineString);
        lines.add(polyline);
    }

    return lines;
}
 
开发者ID:osmdroid,项目名称:osmdroid,代码行数:19,代码来源:OsmMapShapeConverter.java


示例17: buildEnvelope

import mil.nga.wkb.geom.CompoundCurve; //导入依赖的package包/类
/**
 * Build Geometry Envelope
 * 
 * @param geometry
 *            geometry to build envelope from
 * @param envelope
 *            envelope to expand
 */
public static void buildEnvelope(Geometry geometry,
		GeometryEnvelope envelope) {

	GeometryType geometryType = geometry.getGeometryType();
	switch (geometryType) {
	case POINT:
		addPointMessage(envelope, (Point) geometry);
		break;
	case LINESTRING:
		addLineStringMessage(envelope, (LineString) geometry);
		break;
	case POLYGON:
		addPolygonMessage(envelope, (Polygon) geometry);
		break;
	case MULTIPOINT:
		addMultiPointMessage(envelope, (MultiPoint) geometry);
		break;
	case MULTILINESTRING:
		addMultiLineStringMessage(envelope, (MultiLineString) geometry);
		break;
	case MULTIPOLYGON:
		addMultiPolygonMessage(envelope, (MultiPolygon) geometry);
		break;
	case CIRCULARSTRING:
		addLineStringMessage(envelope, (CircularString) geometry);
		break;
	case COMPOUNDCURVE:
		addCompoundCurveMessage(envelope, (CompoundCurve) geometry);
		break;
	case POLYHEDRALSURFACE:
		addPolyhedralSurfaceMessage(envelope, (PolyhedralSurface) geometry);
		break;
	case TIN:
		addPolyhedralSurfaceMessage(envelope, (TIN) geometry);
		break;
	case TRIANGLE:
		addPolygonMessage(envelope, (Triangle) geometry);
		break;
	case GEOMETRYCOLLECTION:
		updateHasZandM(envelope, geometry);
		@SuppressWarnings("unchecked")
		GeometryCollection<Geometry> geomCollection = (GeometryCollection<Geometry>) geometry;
		List<Geometry> geometries = geomCollection.getGeometries();
		for (Geometry subGeometry : geometries) {
			buildEnvelope(subGeometry, envelope);
		}
		break;
	default:
	}

}
 
开发者ID:ngageoint,项目名称:geopackage-wkb-java,代码行数:60,代码来源:GeometryEnvelopeBuilder.java


示例18: getGeometryString

import mil.nga.wkb.geom.CompoundCurve; //导入依赖的package包/类
/**
 * Get Geometry Information as a String
 * 
 * @param geometry
 *            geometry
 * @return geometry String
 */
public static String getGeometryString(Geometry geometry) {

	StringBuilder message = new StringBuilder();

	GeometryType geometryType = geometry.getGeometryType();
	switch (geometryType) {
	case POINT:
		addPointMessage(message, (Point) geometry);
		break;
	case LINESTRING:
		addLineStringMessage(message, (LineString) geometry);
		break;
	case POLYGON:
		addPolygonMessage(message, (Polygon) geometry);
		break;
	case MULTIPOINT:
		addMultiPointMessage(message, (MultiPoint) geometry);
		break;
	case MULTILINESTRING:
		addMultiLineStringMessage(message, (MultiLineString) geometry);
		break;
	case MULTIPOLYGON:
		addMultiPolygonMessage(message, (MultiPolygon) geometry);
		break;
	case CIRCULARSTRING:
		addLineStringMessage(message, (CircularString) geometry);
		break;
	case COMPOUNDCURVE:
		addCompoundCurveMessage(message, (CompoundCurve) geometry);
		break;
	case POLYHEDRALSURFACE:
		addPolyhedralSurfaceMessage(message, (PolyhedralSurface) geometry);
		break;
	case TIN:
		addPolyhedralSurfaceMessage(message, (TIN) geometry);
		break;
	case TRIANGLE:
		addPolygonMessage(message, (Triangle) geometry);
		break;
	case GEOMETRYCOLLECTION:
		@SuppressWarnings("unchecked")
		GeometryCollection<Geometry> geomCollection = (GeometryCollection<Geometry>) geometry;
		message.append("Geometries: " + geomCollection.numGeometries());
		List<Geometry> geometries = geomCollection.getGeometries();
		for (int i = 0; i < geometries.size(); i++) {
			Geometry subGeometry = geometries.get(i);
			message.append("\n\n");
			message.append(Geometry.class.getSimpleName() + " " + (i + 1));
			message.append("\n");
			message.append(subGeometry.getGeometryType().getName());
			message.append("\n");
			message.append(getGeometryString(subGeometry));
		}
		break;
	default:
	}

	return message.toString();
}
 
开发者ID:ngageoint,项目名称:geopackage-wkb-java,代码行数:67,代码来源:GeometryPrinter.java


示例19: getJSONCompatibleGeometry

import mil.nga.wkb.geom.CompoundCurve; //导入依赖的package包/类
/**
 * Get a Geometry object that is JSON compatible
 * 
 * @param geometry
 *            geometry
 * @return geometry JSON object
 */
public static Object getJSONCompatibleGeometry(Geometry geometry) {

	Map<String, Object> jsonObject = new HashMap<>();

	Object geometryObject = null;

	GeometryType geometryType = geometry.getGeometryType();
	switch (geometryType) {
	case POINT:
		geometryObject = getPoint((Point) geometry);
		break;
	case LINESTRING:
		geometryObject = getLineString((LineString) geometry);
		break;
	case POLYGON:
		geometryObject = getPolygon((Polygon) geometry);
		break;
	case MULTIPOINT:
		geometryObject = getMultiPoint((MultiPoint) geometry);
		break;
	case MULTILINESTRING:
		geometryObject = getMultiLineString((MultiLineString) geometry);
		break;
	case MULTIPOLYGON:
		geometryObject = getMultiPolygon((MultiPolygon) geometry);
		break;
	case CIRCULARSTRING:
		geometryObject = getLineString((CircularString) geometry);
		break;
	case COMPOUNDCURVE:
		geometryObject = getCompoundCurve((CompoundCurve) geometry);
		break;
	case POLYHEDRALSURFACE:
		geometryObject = getPolyhedralSurface((PolyhedralSurface) geometry);
		break;
	case TIN:
		geometryObject = getPolyhedralSurface((TIN) geometry);
		break;
	case TRIANGLE:
		geometryObject = getPolygon((Triangle) geometry);
		break;
	case GEOMETRYCOLLECTION:
		List<Object> jsonGeoCollectionObject = new ArrayList<>();
		@SuppressWarnings("unchecked")
		GeometryCollection<Geometry> geomCollection = (GeometryCollection<Geometry>) geometry;
		List<Geometry> geometries = geomCollection.getGeometries();
		for (int i = 0; i < geometries.size(); i++) {
			Geometry subGeometry = geometries.get(i);
			jsonGeoCollectionObject
					.add(getJSONCompatibleGeometry(subGeometry));
		}
		geometryObject = jsonGeoCollectionObject;
		break;
	default:
	}

	if (geometryObject != null) {
		jsonObject.put(geometryType.getName(), geometryObject);
	}

	return jsonObject;
}
 
开发者ID:ngageoint,项目名称:geopackage-wkb-java,代码行数:70,代码来源:GeometryJSONCompatible.java


示例20: minimizeGeometry

import mil.nga.wkb.geom.CompoundCurve; //导入依赖的package包/类
/**
 * Minimize the geometry using the shortest x distance between each
 * connected set of points. The resulting geometry point x values will be in
 * the range: (3 * min value <= x <= 3 * max value
 *
 * Example: For WGS84 provide a max x of 180.0. Resulting x values will be
 * in the range: -540.0 <= x <= 540.0
 *
 * Example: For web mercator provide a world width of 20037508.342789244.
 * Resulting x values will be in the range: -60112525.028367732 <= x <=
 * 60112525.028367732
 *
 * @param geometry
 *            geometry
 * @param maxX
 *            max positive x value in the geometry projection
 */
public static void minimizeGeometry(Geometry geometry, double maxX) {

	GeometryType geometryType = geometry.getGeometryType();
	switch (geometryType) {
	case LINESTRING:
		minimize((LineString) geometry, maxX);
		break;
	case POLYGON:
		minimize((Polygon) geometry, maxX);
		break;
	case MULTILINESTRING:
		minimize((MultiLineString) geometry, maxX);
		break;
	case MULTIPOLYGON:
		minimize((MultiPolygon) geometry, maxX);
		break;
	case CIRCULARSTRING:
		minimize((CircularString) geometry, maxX);
		break;
	case COMPOUNDCURVE:
		minimize((CompoundCurve) geometry, maxX);
		break;
	case POLYHEDRALSURFACE:
		minimize((PolyhedralSurface) geometry, maxX);
		break;
	case TIN:
		minimize((TIN) geometry, maxX);
		break;
	case TRIANGLE:
		minimize((Triangle) geometry, maxX);
		break;
	case GEOMETRYCOLLECTION:
		@SuppressWarnings("unchecked")
		GeometryCollection<Geometry> geomCollection = (GeometryCollection<Geometry>) geometry;
		for (Geometry subGeometry : geomCollection.getGeometries()) {
			minimizeGeometry(subGeometry, maxX);
		}
		break;
	default:
		break;

	}
}
 
开发者ID:ngageoint,项目名称:geopackage-wkb-java,代码行数:61,代码来源:GeometryUtils.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java SamlArgumentExtractor类代码示例发布时间:2022-05-23
下一篇:
Java Feature类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap