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


Java MultiPolygon类代码示例

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


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

示例1: toPolygons

import mil.nga.wkb.geom.MultiPolygon; //导入依赖的package包/类
/**
 * Convert a {@link MultiPolygon} to a {@link MultiPolygonOptions}
 *
 * @param multiPolygon
 * @return
 */
public MultiPolygonOptions toPolygons(MultiPolygon multiPolygon) {

    MultiPolygonOptions polygons = new MultiPolygonOptions();

    for (Polygon polygon : multiPolygon.getPolygons()) {
        PolygonOptions polygonOptions = toPolygon(polygon);
        polygons.add(polygonOptions);
    }

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

示例2: toMultiPolygon

import mil.nga.wkb.geom.MultiPolygon; //导入依赖的package包/类
/**
 * Convert a list of {@link com.google.android.gms.maps.model.Polygon} to a
 * {@link MultiPolygon}
 *
 * @param polygonList
 * @param hasZ
 * @param hasM
 * @return
 */
public MultiPolygon toMultiPolygon(
        List<com.google.android.gms.maps.model.Polygon> polygonList,
        boolean hasZ, boolean hasM) {

    MultiPolygon multiPolygon = new MultiPolygon(hasZ, hasM);

    for (com.google.android.gms.maps.model.Polygon mapPolygon : polygonList) {
        Polygon polygon = toPolygon(mapPolygon);
        multiPolygon.addPolygon(polygon);
    }

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

示例3: createMultiPolygon

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

    MultiPolygon multiPolygon = new MultiPolygon(hasZ, hasM);

    for (Polygon polygon : polygonList) {
        multiPolygon.addPolygon(polygon);
    }

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

示例4: toMultiPolygonFromOptions

import mil.nga.wkb.geom.MultiPolygon; //导入依赖的package包/类
/**
 * Convert a list of {@link PolygonOptions} to a {@link MultiPolygon}
 *
 * @param multiPolygonOptions
 * @param hasZ
 * @param hasM
 * @return
 */
public MultiPolygon toMultiPolygonFromOptions(
        MultiPolygonOptions multiPolygonOptions, boolean hasZ, boolean hasM) {

    MultiPolygon multiPolygon = new MultiPolygon(hasZ, hasM);

    for (PolygonOptions mapPolygon : multiPolygonOptions
            .getPolygonOptions()) {
        Polygon polygon = toPolygon(mapPolygon);
        multiPolygon.addPolygon(polygon);
    }

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

示例5: convertMultiPolygon

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

	MultiPolygonOptions mapPolygons = converter.toPolygons(multiPolygon);
	TestCase.assertNotNull(mapPolygons);
	TestCase.assertFalse(mapPolygons.getPolygonOptions().isEmpty());

	List<Polygon> polygons = multiPolygon.getPolygons();
	comparePolygonsAndMapPolygons(converter, polygons, mapPolygons.getPolygonOptions());

	MultiPolygon multiPolygon2 = converter
			.toMultiPolygonFromOptions(mapPolygons);
	comparePolygons(polygons, multiPolygon2.getPolygons());
}
 
开发者ID:ngageoint,项目名称:geopackage-android-map,代码行数:21,代码来源:GoogleMapShapeConverterUtils.java

示例6: validateMultiPolygon

import mil.nga.wkb.geom.MultiPolygon; //导入依赖的package包/类
/**
 * Validate Multi Polygon
 * 
 * @param topGeometry
 * @param multiPolygon
 */
private static void validateMultiPolygon(Geometry topGeometry,
		MultiPolygon multiPolygon) {

	TestCase.assertEquals(GeometryType.MULTIPOLYGON,
			multiPolygon.getGeometryType());

	validateZAndM(topGeometry, multiPolygon);

	for (Polygon polygon : multiPolygon.getPolygons()) {
		validatePolygon(topGeometry, polygon);
	}

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

示例7: compareMultiPolygon

import mil.nga.wkb.geom.MultiPolygon; //导入依赖的package包/类
/**
 * Compare the two multi polygons for equality
 *
 * @param expected
 * @param actual
 * @param delta
 */
private static void compareMultiPolygon(MultiPolygon expected,
										MultiPolygon actual, double delta) {

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

示例8: transform

import mil.nga.wkb.geom.MultiPolygon; //导入依赖的package包/类
/**
 * Transform the projected multi polygon
 * 
 * @param multiPolygon
 * @return projected multi polygon
 */
public MultiPolygon transform(MultiPolygon multiPolygon) {

	MultiPolygon to = new MultiPolygon(multiPolygon.hasZ(),
			multiPolygon.hasM());

	for (Polygon polygon : multiPolygon.getPolygons()) {
		Polygon toPolygon = transform(polygon);
		to.addPolygon(toPolygon);
	}

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

示例9: compareMultiPolygon

import mil.nga.wkb.geom.MultiPolygon; //导入依赖的package包/类
/**
 * Compare the two multi polygons for equality
 * 
 * @param expected
 * @param actual
 * @param delta
 */
private static void compareMultiPolygon(MultiPolygon expected,
		MultiPolygon actual, double delta) {

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

示例10: addMultiPolygonMessage

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

	updateHasZandM(envelope, multiPolygon);

	List<Polygon> polygons = multiPolygon.getPolygons();
	for (Polygon polygon : polygons) {
		addPolygonMessage(envelope, polygon);
	}
}
 
开发者ID:ngageoint,项目名称:geopackage-wkb-java,代码行数:17,代码来源:GeometryEnvelopeBuilder.java

示例11: addMultiPolygonMessage

import mil.nga.wkb.geom.MultiPolygon; //导入依赖的package包/类
/**
 * Add MultiPolygon message
 * 
 * @param message
 * @param multiPolygon
 */
private static void addMultiPolygonMessage(StringBuilder message,
		MultiPolygon multiPolygon) {
	message.append(Polygon.class.getSimpleName() + "s: "
			+ multiPolygon.numPolygons());
	List<Polygon> polygons = multiPolygon.getPolygons();
	for (int i = 0; i < polygons.size(); i++) {
		Polygon polygon = polygons.get(i);
		message.append("\n\n");
		message.append(Polygon.class.getSimpleName() + " " + (i + 1));
		message.append("\n");
		addPolygonMessage(message, polygon);
	}
}
 
开发者ID:ngageoint,项目名称:geopackage-wkb-java,代码行数:20,代码来源:GeometryPrinter.java

示例12: getMultiPolygon

import mil.nga.wkb.geom.MultiPolygon; //导入依赖的package包/类
/**
 * Get MultiPolygon object
 * 
 * @param multiPolygon
 * @return multi polygon object
 */
private static Object getMultiPolygon(MultiPolygon multiPolygon) {
	List<Object> jsonObject = new ArrayList<>();
	List<Polygon> polygons = multiPolygon.getPolygons();
	for (int i = 0; i < polygons.size(); i++) {
		Polygon polygon = polygons.get(i);
		jsonObject.add(getPolygon(polygon));
	}
	return jsonObject;
}
 
开发者ID:ngageoint,项目名称:geopackage-wkb-java,代码行数:16,代码来源:GeometryJSONCompatible.java

示例13: add

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

	GeometryType geometryType = geometry.getGeometryType();
	switch (geometryType) {
	case POLYGON:
	case TRIANGLE:
		add((Polygon) geometry);
		break;
	case MULTIPOLYGON:
		MultiPolygon multiPolygon = (MultiPolygon) geometry;
		add(multiPolygon.getPolygons());
		break;
	case POLYHEDRALSURFACE:
	case TIN:
		PolyhedralSurface polyhedralSurface = (PolyhedralSurface) geometry;
		add(polyhedralSurface.getPolygons());
		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:
	case LINESTRING:
	case CIRCULARSTRING:
	case MULTILINESTRING:
	case COMPOUNDCURVE:
		// Doesn't contribute to surface dimension
		break;
	default:
		throw new WkbException("Unsupported "
				+ this.getClass().getSimpleName() + " Geometry Type: "
				+ geometryType);
	}
}
 
开发者ID:ngageoint,项目名称:geopackage-wkb-java,代码行数:47,代码来源:CentroidSurface.java

示例14: writeMultiPolygon

import mil.nga.wkb.geom.MultiPolygon; //导入依赖的package包/类
/**
 * Write a Multi Polygon
 * 
 * @param writer
 * @param multiPolygon
 * @throws IOException
 */
public static void writeMultiPolygon(ByteWriter writer,
		MultiPolygon multiPolygon) throws IOException {

	writer.writeInt(multiPolygon.numPolygons());

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

示例15: testMultiPolygon

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

	for (int i = 0; i < GEOMETRIES_PER_TEST; i++) {
		// Create and test a multi polygon
		MultiPolygon multiPolygon = WKBTestUtils.createMultiPolygon(
				WKBTestUtils.coinFlip(), WKBTestUtils.coinFlip());
		geometryTester(multiPolygon);
	}

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


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