Convert a list of {@link com.google.android.gms.maps.model.Polygon} to a
{@link MultiPolygon}

@param polygonList polygon list
@return multi polygon
967910
public MultiPolygon toMultiPolygon(
            List<com.google.android.gms.maps.model.Polygon> polygonList) {
        return toMultiPolygon(polygonList, false, false);
    }
195463
public static MultiPolyline addPolylinesToMap(MapView map,
                                                  List<Polyline> polylines) {
        MultiPolyline multiPolyline = new MultiPolyline();

        for (Polyline line : polylines) {
            if (line.getInfoWindow()==null)
            line.setInfoWindow(new BasicInfoWindow(R.layout.bonuspack_bubble, map));
            map.getOverlayManager().add(line);
            multiPolyline.add(line);
        }
        return multiPolyline;
    }
1086152
@SuppressWarnings("unchecked")
    protected List _transform(final List list) {
        if (list == null) return null;
        if (list instanceof BeanList) return list;
        return new BeanList(list, this);
    }
459312
public static MultiPolygon of(Stream<Polygon> polygons) {
        return of(polygons.collect(Collectors.toList()));
    }
79577
public NodeList nodelist() throws javax.xml.transform.TransformerException
  {

    error(XPATHErrorResources.ER_CANT_CONVERT_TO_NODELIST,
          new Object[]{ getTypeString() });  //"Can not convert "+getTypeString()+" to a NodeList!");

    return null;
  }
759394
public List<GoogleMapShape> addToMap(GoogleMap map,
                                         GeometryCollection<Geometry> geometryCollection) {

        List<GoogleMapShape> shapes = new ArrayList<GoogleMapShape>();

        for (Geometry geometry : geometryCollection.getGeometries()) {
            GoogleMapShape shape = addToMap(map, geometry);
            shapes.add(shape);
        }

        return shapes;
    }
323748
public PolygonOptions toPolygon(Polygon polygon) {

        PolygonOptions polygonOptions = new PolygonOptions();

        List<LineString> rings = polygon.getRings();

        if (!rings.isEmpty()) {

            Double z = null;

            // Add the polygon points
            LineString polygonLineString = rings.get(0);

            // Try to simplify the number of points in the polygon ring
            List<Point> points = simplifyPoints(polygonLineString.getPoints());

            for (Point point : points) {
                LatLng latLng = toLatLng(point);
                polygonOptions.add(latLng);
                if (point.hasZ()) {
                    z = (z == null) ? point.getZ() : Math.max(z, point.getZ());
                }
            }

            // Add the holes
            for (int i = 1; i < rings.size(); i++) {
                LineString hole = rings.get(i);

                // Try to simplify the number of points in the polygon hole
                List<Point> holePoints = simplifyPoints(hole.getPoints());

                List<LatLng> holeLatLngs = new ArrayList<LatLng>();
                for (Point point : holePoints) {
                    LatLng latLng = toLatLng(point);
                    holeLatLngs.add(latLng);
                    if (point.hasZ()) {
                        z = (z == null) ? point.getZ() : Math.max(z,
                                point.getZ());
                    }
                }
                polygonOptions.addHole(holeLatLngs);
            }

            if (polygon.hasZ() && z != null) {
                polygonOptions.zIndex(z.floatValue());
            }
        }

        return polygonOptions;
    }
665894
public static Polygon create(org.locationtech.jts.geom.Polygon polygon) {
        double[] lats = new double[polygon.getNumPoints()];
        double[] lons = new double[polygon.getNumPoints()];
        for (int i = 0; i < polygon.getNumPoints(); i++) {
            lats[i] = polygon.getCoordinates()[i].y;
            lons[i] = polygon.getCoordinates()[i].x;
        }
        return new Polygon(lats, lons);
    }
848700
private static Polygon processPolygon(Polygon p, Geometry triangleLines, GeometryFactory factory) {
        Geometry diffExt = p.getExteriorRing().difference(triangleLines);
        final int nbOfHoles = p.getNumInteriorRing();
        final LinearRing[] holes = new LinearRing[nbOfHoles];
        for (int i = 0; i < nbOfHoles; i++) {
            holes[i] = factory.createLinearRing(lineMerge(p.getInteriorRingN(i).difference(triangleLines), factory).getCoordinates());
        }
        return factory.createPolygon(factory.createLinearRing(lineMerge(diffExt, factory).getCoordinates()), holes);

    }
725560
public static JtsGeomStats getStats(List<Geometry> flatGeomList) {
        final JtsGeomStats stats = new JtsGeomStats();

        for(Geometry nextGeom : flatGeomList) {
            final VectorTile.Tile.GeomType geomType = JtsAdapter.toGeomType(nextGeom);

            // Count features by type
            Integer value = stats.featureCounts.get(geomType);
            value = value == null ? 1 : value + 1;
            stats.featureCounts.put(geomType, value);

            // Get stats per feature
            stats.featureStats.add(getStats(nextGeom, geomType));
        }

        return stats;
    }
378906
public static Geometry removeHoles(Geometry geometry) {
        if(geometry == null){
            return null;
        }
        if (geometry instanceof Polygon) {
            return removeHolesPolygon((Polygon) geometry);
        } else if (geometry instanceof MultiPolygon) {
            return removeHolesMultiPolygon((MultiPolygon) geometry);
        } else if (geometry instanceof GeometryCollection) {
            Geometry[] geometries = new Geometry[geometry.getNumGeometries()];
            for (int i = 0; i < geometry.getNumGeometries(); i++) {
                Geometry geom = geometry.getGeometryN(i);
                if (geometry instanceof Polygon) {
                    geometries[i] = removeHolesPolygon((Polygon) geom);
                } else if (geometry instanceof MultiPolygon) {
                    geometries[i] = removeHolesMultiPolygon((MultiPolygon) geom);
                } else {
                    geometries[i] = geom;
                }
            }
            return FACTORY.createGeometryCollection(geometries);
        }
        return null;
    }
861115
public ListMultimap<String, String> asObject() {
		if (values.isEmpty()) {
			return new ListMultimap<String, String>(0);
		}

		Map<String, JsonValue> map = values.get(0).getObject();
		if (map == null) {
			return new ListMultimap<String, String>(0);
		}

		ListMultimap<String, String> values = new ListMultimap<String, String>();
		for (Map.Entry<String, JsonValue> entry : map.entrySet()) {
			String key = entry.getKey();
			JsonValue value = entry.getValue();

			if (value.isNull()) {
				values.put(key, "");
				continue;
			}

			Object obj = value.getValue();
			if (obj != null) {
				values.put(key, obj.toString());
				continue;
			}

			List<JsonValue> array = value.getArray();
			if (array != null) {
				for (JsonValue element : array) {
					if (element.isNull()) {
						values.put(key, "");
						continue;
					}

					obj = element.getValue();
					if (obj != null) {
						values.put(key, obj.toString());
					}
				}
			}
		}
		return values;
	}
1215133
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;
    }
67970
public List<Polygon2D_F64> getPolygons( @Nullable List<Polygon2D_F64> storage ,
											@Nullable List<DetectPolygonFromContour.Info> storageInfo ) {
		if( storage == null )
			storage = new ArrayList<>();
		else
			storage.clear();

		if( storageInfo != null )
			storageInfo.clear();

		List<DetectPolygonFromContour.Info> detections = detector.getFound().toList();
		for (int i = 0; i < detections.size(); i++) {
			DetectPolygonFromContour.Info d = detections.get(i);

			if( d.computeEdgeIntensity() >= minimumRefineEdgeIntensity ) {
				storage.add(d.polygon);
				if( storageInfo != null ) {
					storageInfo.add(d);
				}
			}
		}
		return storage;
	}
63487
public MultiPolygonOptions toPolygons(PolyhedralSurface polyhedralSurface) {

        MultiPolygonOptions polygons = new MultiPolygonOptions();

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

        return polygons;
    }
1082360
public static mil.nga.geopackage.map.geom.MultiPolygon addPolygonsToMap(
            GoogleMap map, MultiPolygonOptions polygons) {
        mil.nga.geopackage.map.geom.MultiPolygon multiPolygon = new mil.nga.geopackage.map.geom.MultiPolygon();
        for (PolygonOptions polygonOption : polygons.getPolygonOptions()) {
            if (polygons.getOptions() != null) {
                polygonOption.fillColor(polygons.getOptions().getFillColor());
                polygonOption.strokeColor(polygons.getOptions()
                        .getStrokeColor());
                polygonOption.geodesic(polygons.getOptions().isGeodesic());
                polygonOption.visible(polygons.getOptions().isVisible());
                polygonOption.zIndex(polygons.getOptions().getZIndex());
                polygonOption.strokeWidth(polygons.getOptions().getStrokeWidth());
            }
            com.google.android.gms.maps.model.Polygon polygon = addPolygonToMap(
                    map, polygonOption);
            multiPolygon.add(polygon);
        }
        return multiPolygon;
    }
935228
public ListMultimap<Class<?>, Object> getParamsForType() {
		ArrayListMultimap<Class<?>, Object> retVal = ArrayListMultimap.create();
		myParams.entries().forEach(entry -> retVal.put(entry.getKey(), unwrapValue(entry.getValue())));
		return Multimaps.unmodifiableListMultimap(retVal);
	}