# Path: rivus/utils/pandashp.py
# def read_shp(filename):
# def write_shp(filename, dataframe, write_index=True):
# def match_vertices_and_edges(vertices, edges, vertex_cols=('Vertex1', 'Vertex2')):
# def find_closest_edge(polygons, edges, to_attr='index', column='nearest'):
# def bounds(df):
# def total_bounds(df):


import warnings
    import pyomo.core as pyomo
    import coopr.pyomo as pyomo
import math
import matplotlib.pyplot as plt
import matplotlib.patheffects as pe
import numpy as np
import os
import pandas as pd
import warnings
    import gzip
        import cPickle as pickle
        import pickle
    import gzip
        import cPickle as pickle
        import pickle
from ..utils import pandashp as pdshp
from geopy.distance import distance
from mpl_toolkits.basemap import Basemap
        from collections import defaultdict
        from matplotlib.patches import Polygon
        from matplotlib.collections import PatchCollection
    commodity
        str like `Elec`, `Heat` etc.
    plot_demand
        If True, plot demand, else plot capacities
    mapscale : Boolean
        If True, add mapscale to plot (default: False)
    tick_labels : Boolean
        If True, add lon/lat tick labels (default: True)
    annotations : Boolean
        If True, add numeric labels to graph (default: True)
    buildings : tuple
        tuple of (filename to shapefile, boolean)
        if true, color buildings according to attribute column
        "type" and colors in constant rivus.COLORS; else use default
        COLOR['building'] for all
    shapefiles : list
        list of dicts of shapefiles that shall be drawn by
        basemap function readshapefile. is passed as `**kwargs`
    decoration : Boolean
        Switch for map decoration (meridian, parallels)
    boundary : Boolean
        Draw map border or not.

    Returns
    -------
    fig
        the map figure object
    """
    complex_plot = True
    # set up Basemap for extent

# Path: rivus/utils/pandashp.py
# def read_shp(filename):
# def write_shp(filename, dataframe, write_index=True):
# def match_vertices_and_edges(vertices, edges, vertex_cols=('Vertex1', 'Vertex2')):
# def find_closest_edge(polygons, edges, to_attr='index', column='nearest'):
# def bounds(df):
# def total_bounds(df):


# Path: rivus/main/rivus.py
import warnings
    import pyomo.core as pyomo
    import coopr.pyomo as pyomo
import math
import matplotlib.pyplot as plt
import matplotlib.patheffects as pe
import numpy as np
import os
import pandas as pd
import warnings
    import gzip
        import cPickle as pickle
        import pickle
    import gzip
        import cPickle as pickle
        import pickle
from ..utils import pandashp as pdshp
from geopy.distance import distance
from mpl_toolkits.basemap import Basemap
        from collections import defaultdict
        from matplotlib.patches import Polygon
        from matplotlib.collections import PatchCollection

    commodity
        str like `Elec`, `Heat` etc.
    plot_demand
        If True, plot demand, else plot capacities
    mapscale : Boolean
        If True, add mapscale to plot (default: False)
    tick_labels : Boolean
        If True, add lon/lat tick labels (default: True)
    annotations : Boolean
        If True, add numeric labels to graph (default: True)
    buildings : tuple
        tuple of (filename to shapefile, boolean)
        if true, color buildings according to attribute column
        "type" and colors in constant rivus.COLORS; else use default
        COLOR['building'] for all
    shapefiles : list
        list of dicts of shapefiles that shall be drawn by
        basemap function readshapefile. is passed as `**kwargs`
    decoration : Boolean
        Switch for map decoration (meridian, parallels)
    boundary : Boolean
        Draw map border or not.

    Returns
    -------
    fig
        the map figure object
    """
    complex_plot = True
    # set up Basemap for extent

    bbox = pdshp.total_bounds(prob.params['vertex'])