class_docstr: Define an ellipsoid on which to solve geodesic problems.
docstr: Return the distance (in physical meters) of the given Shapely geometry.
  
  The geometry is assumed to be in spherical (lon, lat) coordinates.
  
  Parameters
  ----------
  geometry : `shapely.geometry.BaseGeometry`
      The Shapely geometry to compute the length of. For polygons, the
      exterior length will be calculated. For multi-part geometries, the
      sum of the parts will be computed.
code: def geometry_length(self, geometry):
      """
      Return the distance (in physical meters) of the given Shapely geometry.
  
      The geometry is assumed to be in spherical (lon, lat) coordinates.
  
      Parameters
      ----------
      geometry : `shapely.geometry.BaseGeometry`
          The Shapely geometry to compute the length of. For polygons, the
          exterior length will be calculated. For multi-part geometries, the
          sum of the parts will be computed.
  
      """
      result = None
      if hasattr(geometry, "geoms"):
          # Multi-geometry.
          result = sum(
              self.geometry_length(geom) for geom in geometry.geoms
          )
  
      elif hasattr(geometry, "exterior"):
          # Polygon.
          result = self.geometry_length(geometry.exterior)
  
      elif hasattr(geometry, "coords") and not isinstance(
          geometry, sgeom.Point
      ):
          coords = np.array(geometry.coords)
          result = self.geometry_length(coords)
  
      elif isinstance(geometry, np.ndarray):
          coords = geometry
          distances, _, _ = np.array(
              self.inverse(coords[:-1, :], coords[1:, :]).T
          )
          result = distances.sum()
  
      else:
          raise TypeError(f"Unhandled type {geometry.__class__}")
  
      return result
  
file_path: cartopy/lib/cartopy/geodesic.py
imports: import numpy
  import pyproj
  import shapely.geometry
label_desc: Use image node_id 6 for calling the Geodesic obj's underlying member method code with example usage: obj.geometry_length(geometry) and returns: result