class_docstr: Draw map feature
  
  The map feature are drawn without any special projections.
  
  {usage}
  
  Parameters
  ----------
  {common_parameters}
  
  Notes
  -----
  This geom is best suited for plotting a shapefile read into
  geopandas dataframe. The dataframe should have a `geometry`
  column.
class_docstr_tok: ["Draw","map","feature","The","map","feature","are","drawn","without","any","special","projections",".","{","usage","}","Parameters","--","--","--","--","--","{","common_parameters","}","Notes","--","--","-","This","geom","is","best","suited","for","plotting","a","shapefile","read","into","geopandas","dataframe",".","The","dataframe","should","have","a","`","geometry","`","column","."]
code: def setup_data(self, data: pd.DataFrame) -> pd.DataFrame:
      if not len(data):
          return data
  
      # Remove any NULL geometries, and remember
      # All the non-Null shapes in a shapefile are required to be
      # of the same shape type.
      bool_idx = np.array([g is not None for g in data["geometry"]])
      if not np.all(bool_idx):
          data = data.loc[bool_idx]
  
      # Add polygon limits. Scale training uses them
      try:
          bounds = data["geometry"].bounds
      except AttributeError:
          # The geometry is not a GeoSeries
          # Bounds calculation is extracted from
          # geopandas.base.GeoPandasBase.bounds
          bounds = pd.DataFrame(
              np.array([x.bounds for x in data["geometry"]]),
              columns=["xmin", "ymin", "xmax", "ymax"],
              index=data.index,
          )
      else:
          bounds.rename(
              columns={
                  "minx": "xmin",
                  "maxx": "xmax",
                  "miny": "ymin",
                  "maxy": "ymax",
              },
              inplace=True,
          )
  
      data = pd.concat([data, bounds], axis=1)
      return data
  
file_path: plotnine/plotnine/geoms/geom_map.py
imports: from __future__ import annotations
  import typing
  import numpy
  import pandas
  from .._utils import SIZE_FACTOR, to_rgba
  from ..doctools import document
  from ..exceptions import PlotnineError
  from .geom import geom
  from .geom_point import geom_point
  from .geom_polygon import geom_polygon
label_desc: Use image node_id 2 for calling the geom_map obj's underlying member method code with example usage: obj.setup_data(data) and returns: data, data