本文整理汇总了Java中mil.nga.wkb.geom.MultiPolygon.getPolygons方法的典型用法代码示例。如果您正苦于以下问题:Java MultiPolygon.getPolygons方法的具体用法?Java MultiPolygon.getPolygons怎么用?Java MultiPolygon.getPolygons使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mil.nga.wkb.geom.MultiPolygon
的用法示例。
在下文中一共展示了MultiPolygon.getPolygons方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: 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());
}
示例3: 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);
}
}
示例4: 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;
}
示例5: 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);
}
}
示例6: 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);
}
}
示例7: 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;
}
示例8: 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);
}
}
示例9: minimize
import mil.nga.wkb.geom.MultiPolygon; //导入方法依赖的package包/类
/**
* Minimize the multi polygon
*
* @param multiPolygon
* multi polygon
* @param maxX
* max positive x value in the geometry projection
*/
private static void minimize(MultiPolygon multiPolygon, double maxX) {
List<Polygon> polygons = multiPolygon.getPolygons();
for (Polygon polygon : polygons) {
minimize(polygon, maxX);
}
}
示例10: normalize
import mil.nga.wkb.geom.MultiPolygon; //导入方法依赖的package包/类
/**
* Normalize the multi polygon
*
* @param multiPolygon
* multi polygon
* @param maxX
* max positive x value in the geometry projection
*/
private static void normalize(MultiPolygon multiPolygon, double maxX) {
List<Polygon> polygons = multiPolygon.getPolygons();
for (Polygon polygon : polygons) {
normalize(polygon, maxX);
}
}
示例11: toPolygons
import mil.nga.wkb.geom.MultiPolygon; //导入方法依赖的package包/类
/**
* Convert a {@link MultiPolygon} to a {@link Polygon}
*
* @param multiPolygon
* @return
*/
public List<org.osmdroid.views.overlay.Polygon> toPolygons(MultiPolygon multiPolygon) {
List<org.osmdroid.views.overlay.Polygon> polygons = new ArrayList<>();
for (Polygon polygon : multiPolygon.getPolygons()) {
org.osmdroid.views.overlay.Polygon polygonOptions = toPolygon(polygon);
polygons.add(polygonOptions);
}
return polygons;
}