def edge(geom):
    """
    return a polygon representing the edge of `geom`
    """
    h = 1e-8
    try:
        geomext = geom.exterior
    except:
        try:
            geomext = geom.buffer(h).exterior
        except:
            geomext = geom
    return geomext