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


Java MultiLineString类代码示例

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


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


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