pub fn with_rings(mut rings: Vec<PolygonRing<PointType>>) -> Self {
        rings.iter_mut().for_each(PolygonRing::close_and_reorder);
        let mut bbox = GenericBBox::<PointType>::from_points(rings[0].points());
        for ring in &rings[1..] {
            bbox.grow_from_points(ring.points());
        }
        Self { bbox, rings }
    }
/// Creates a polygon with multiple rings
///
/// The ring will be closed if it is not
/// (shapefiles requires the first and last point to be equal)
///
/// The ring points may be reordered to match their type
/// (see [`PolygonRing`])
///
///
/// # Example
///
/// ```
/// use shapefile::{PolygonRing, Point, Polygon};
/// let polygon = Polygon::with_rings(vec![
///     PolygonRing::Outer(vec![
///         Point::new(-120.0, 60.0),
///         Point::new(-120.0, -60.0),
///         Point::new(120.0, -60.0),
///         Point::new(120.0, 60.0),
///         Point::new(-120.0, 60.0),
///     ]),
///     PolygonRing::Inner(vec![
///          Point::new(-60.0, 30.0),
///          Point::new(60.0, 30.0),
///          Point::new(60.0, -30.0),
///          Point::new(-60.0, -30.0),
///          Point::new(-60.0, 30.0),
///     ]),
/// ]);
///
/// assert_eq!(polygon.rings().len(), 2);
/// ```
///
/// [`PolygonRing`]: enum.PolygonRing.html
Creates a polygon with multiple rings
The ring will be closed if it is not
(shapefiles requires the first and last point to be equal)

The ring points may be reordered to match their type
Creates a polygon with multiple rings The ring will be closed if it is not ( shapefiles requires the first and last point to be equal ) The ring points may be reordered to match their type
pub fn with_rings(mut rings: Vec<PolygonRing<PointType>>) -> Self {
        rings.iter_mut().for_each(PolygonRing::close_and_reorder);
        let mut bbox = GenericBBox::<PointType>::from_points(rings[0].points());
        for ring in &rings[1..] {
            bbox.grow_from_points(ring.points());
        }
        Self { bbox, rings }
    }
pub fn with_rings ( mut rings : Vec < PolygonRing < PointType > > ) -> Self { rings . iter_mut ( ) . for_each ( PolygonRing :: close_and_reorder ) ; let mut bbox = GenericBBox :: < PointType > :: from_points ( rings [ 0 ] . points ( ) ) ; for ring in & rings [ 1 .. ] { bbox . grow_from_points ( ring . points ( ) ) ; } Self { bbox , rings } }
Creates a polygon with multiple rings
The ring will be closed if it is not
(shapefiles requires the first and last point to be equal)
Creates a polygon with multiple rings The ring will be closed if it is not ( shapefiles requires the first and last point to be equal )
rings
Vec<PolygonRing<PointType>>
example
None