cartography 0.11.0

Cartography is a map rendering library for Geographic features expressed using [georust](https://georust.org/) libraries.
Documentation
pub(crate) trait GeometryExt
{
  fn geometry_type(&self) -> GeometryType;
  fn element_geometry_type(&self) -> GeometryType;
}

impl GeometryExt for geo::Geometry
{
  fn geometry_type(&self) -> GeometryType
  {
    match self
    {
      geo::Geometry::Point(_) => GeometryType::Point,
      geo::Geometry::Line(_) => GeometryType::Line,
      geo::Geometry::LineString(_) => GeometryType::LineString,
      geo::Geometry::Polygon(_) => GeometryType::Polygon,
      geo::Geometry::MultiPoint(_) => GeometryType::Collection,
      geo::Geometry::MultiLineString(_) => GeometryType::Collection,
      geo::Geometry::MultiPolygon(_) => GeometryType::Collection,
      geo::Geometry::GeometryCollection(_) => GeometryType::Collection,
      geo::Geometry::Rect(_) => GeometryType::Polygon,
      geo::Geometry::Triangle(_) => GeometryType::Polygon,
    }
  }
  fn element_geometry_type(&self) -> GeometryType
  {
    match self
    {
      geo::Geometry::Point(_) => GeometryType::Invalid,
      geo::Geometry::Line(_) => GeometryType::Invalid,
      geo::Geometry::LineString(_) => GeometryType::Invalid,
      geo::Geometry::Polygon(_) => GeometryType::Invalid,
      geo::Geometry::MultiPoint(_) => GeometryType::Point,
      geo::Geometry::MultiLineString(_) => GeometryType::LineString,
      geo::Geometry::MultiPolygon(_) => GeometryType::Polygon,
      geo::Geometry::GeometryCollection(_) => GeometryType::Invalid,
      geo::Geometry::Rect(_) => GeometryType::Invalid,
      geo::Geometry::Triangle(_) => GeometryType::Invalid,
    }
  }
}

/// Enumerate of the different geometry type
#[allow(missing_docs)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum GeometryType
{
  Point,
  Line,
  LineString,
  Polygon,
  Collection,
  Invalid,
}