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

Java MultiLineString类代码示例

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

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



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

示例1: convertMultiLineString

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

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

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

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


示例2: toPolylines

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

    MultiPolylineOptions polylines = new MultiPolylineOptions();

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

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


示例3: toMultiLineString

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

    MultiLineString multiLineString = new MultiLineString(hasZ, hasM);

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

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


示例4: toMultiLineStringFromList

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

    MultiLineString multiLineString = new MultiLineString(hasZ, hasM);

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

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


示例5: toMultiLineStringFromOptions

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

    MultiLineString multiLineString = new MultiLineString(hasZ, hasM);

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

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


示例6: validateMultiLineString

import mil.nga.wkb.geom.MultiLineString; //导入依赖的package包/类
/**
 * Validate Multi Line String
 * 
 * @param topGeometry
 * @param multiLineString
 */
private static void validateMultiLineString(Geometry topGeometry,
		MultiLineString multiLineString) {

	TestCase.assertEquals(GeometryType.MULTILINESTRING,
			multiLineString.getGeometryType());

	validateZAndM(topGeometry, multiLineString);

	for (LineString lineString : multiLineString.getLineStrings()) {
		validateLineString(topGeometry, lineString);
	}

}
 
开发者ID:ngageoint,项目名称:geopackage-android,代码行数:20,代码来源:FeatureUtils.java


示例7: compareMultiLineString

import mil.nga.wkb.geom.MultiLineString; //导入依赖的package包/类
/**
 * Compare the two multi line strings for equality
 *
 * @param expected
 * @param actual
 * @parma delta
 */
private static void compareMultiLineString(MultiLineString expected,
										   MultiLineString 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.MultiLineString; //导入依赖的package包/类
/**
 * Transform the projected multi line string
 * 
 * @param multiLineString
 * @return projected multi line string
 */
public MultiLineString transform(MultiLineString multiLineString) {

	MultiLineString to = new MultiLineString(multiLineString.hasZ(),
			multiLineString.hasM());

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

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


示例9: compareMultiLineString

import mil.nga.wkb.geom.MultiLineString; //导入依赖的package包/类
/**
 * Compare the two multi line strings for equality
 * 
 * @param expected
 * @param actual
 * @parma delta
 */
private static void compareMultiLineString(MultiLineString expected,
		MultiLineString 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: addMultiLineStringMessage

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

	updateHasZandM(envelope, multiLineString);

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


示例11: add

import mil.nga.wkb.geom.MultiLineString; //导入依赖的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: addMultiLineStringMessage

import mil.nga.wkb.geom.MultiLineString; //导入依赖的package包/类
/**
 * Add MultiLineString message
 * 
 * @param message
 * @param multiLineString
 */
private static void addMultiLineStringMessage(StringBuilder message,
		MultiLineString multiLineString) {
	message.append(LineString.class.getSimpleName() + "s: "
			+ multiLineString.numLineStrings());
	List<LineString> lineStrings = multiLineString.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: getMultiLineString

import mil.nga.wkb.geom.MultiLineString; //导入依赖的package包/类
/**
 * Get MultiLineString object
 * 
 * @param multiLineString
 * @return multi line string object
 */
private static Object getMultiLineString(MultiLineString multiLineString) {
	List<Object> jsonObject = new ArrayList<>();
	List<LineString> lineStrings = multiLineString.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: writeMultiLineString

import mil.nga.wkb.geom.MultiLineString; //导入依赖的package包/类
/**
 * Write a Multi Line String
 * 
 * @param writer
 * @param multiLineString
 * @throws IOException
 */
public static void writeMultiLineString(ByteWriter writer,
		MultiLineString multiLineString) throws IOException {

	writer.writeInt(multiLineString.numLineStrings());

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


示例15: testMultiLineString

import mil.nga.wkb.geom.MultiLineString; //导入依赖的package包/类
@Test
public void testMultiLineString() throws IOException {

	for (int i = 0; i < GEOMETRIES_PER_TEST; i++) {
		// Create and test a multi line string
		MultiLineString multiLineString = WKBTestUtils
				.createMultiLineString(WKBTestUtils.coinFlip(),
						WKBTestUtils.coinFlip());
		geometryTester(multiLineString);
	}

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


示例16: testMultiLineStringCentroid

import mil.nga.wkb.geom.MultiLineString; //导入依赖的package包/类
@Test
public void testMultiLineStringCentroid() throws IOException {

	for (int i = 0; i < GEOMETRIES_PER_TEST; i++) {
		// Create and test a multi line string
		MultiLineString multiLineString = WKBTestUtils
				.createMultiLineString(WKBTestUtils.coinFlip(),
						WKBTestUtils.coinFlip());
		TestCase.assertEquals(1,
				GeometryUtils.getDimension(multiLineString));
		geometryCentroidTester(multiLineString);
	}

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


示例17: compareMultiLineString

import mil.nga.wkb.geom.MultiLineString; //导入依赖的package包/类
/**
 * Compare the two multi line strings for equality
 * 
 * @param expected
 * @param actual
 */
public static void compareMultiLineString(MultiLineString expected,
		MultiLineString 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


示例18: createMultiLineString

import mil.nga.wkb.geom.MultiLineString; //导入依赖的package包/类
/**
 * Create a random multi line string
 * 
 * @param hasZ
 * @param hasM
 * @return
 */
public static MultiLineString createMultiLineString(boolean hasZ,
		boolean hasM) {

	MultiLineString multiLineString = new MultiLineString(hasZ, hasM);

	int num = 1 + ((int) (Math.random() * 5));

	for (int i = 0; i < num; i++) {
		multiLineString.addLineString(createLineString(hasZ, hasM));
	}

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


示例19: toPolylines

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

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

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

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


示例20: validateGeometry

import mil.nga.wkb.geom.MultiLineString; //导入依赖的package包/类
/**
 * Validate the geometry
 * 
 * @param geometryType
 * @param geometry
 */
private static void validateGeometry(GeometryType geometryType,
		Geometry geometry) {

	switch (geometryType) {
	case POINT:
		TestCase.assertTrue(geometry instanceof Point);
		Point point = (Point) geometry;
		validatePoint(point, point);
		break;
	case LINESTRING:
		TestCase.assertTrue(geometry instanceof LineString);
		LineString lineString = (LineString) geometry;
		validateLineString(lineString, lineString);
		break;
	case POLYGON:
		TestCase.assertTrue(geometry instanceof Polygon);
		Polygon polygon = (Polygon) geometry;
		validatePolygon(polygon, polygon);
		break;
	case MULTIPOINT:
		TestCase.assertTrue(geometry instanceof MultiPoint);
		MultiPoint multiPoint = (MultiPoint) geometry;
		validateMultiPoint(multiPoint, multiPoint);
		break;
	case MULTILINESTRING:
		TestCase.assertTrue(geometry instanceof MultiLineString);
		MultiLineString multiLineString = (MultiLineString) geometry;
		validateMultiLineString(multiLineString, multiLineString);
		break;
	case MULTIPOLYGON:
		TestCase.assertTrue(geometry instanceof MultiPolygon);
		MultiPolygon multiPolygon = (MultiPolygon) geometry;
		validateMultiPolygon(multiPolygon, multiPolygon);
		break;
	case GEOMETRYCOLLECTION:
		TestCase.assertTrue(geometry instanceof GeometryCollection);
		GeometryCollection<?> geometryCollection = (GeometryCollection<?>) geometry;
		validateGeometryCollection(geometryCollection, geometryCollection);
		break;
	default:

	}
}
 
开发者ID:ngageoint,项目名称:geopackage-android,代码行数:50,代码来源:FeatureUtils.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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