示例#1
0
def from_cartopy(crs):
    """Converts a cartopy CRS to a workflow CRS.

    Parameters
    ----------
    epsg : int
        An EPSG code. (see `https://epsg.io`_)

    Returns
    -------
    out : crs-type
        Equivalent workflow CRS.

    """
    return CRS.from_dict(crs.proj4_params)
示例#2
0
def from_fiona(crs):
    """Converts a fiona CRS to the workflow CRS standard.

    Parameters
    ----------
    crs : fiona-crs-dict
        Input fiona CRS, which is a dictionary containing an EPSG
        code.

    Returns
    -------
    out : crs-type
        Equivalent workflow CRS.

    """
    # if 'datum' in crs and crs['datum'] == 'WGS84' and 'epsg' not in crs and 'ellps' not in crs:
    #     logging.warning('Old-style datum WGS84, moving to ellipse')
    #     crs['ellps'] = crs.pop('datum')
    return CRS.from_dict(crs)