Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)
Loads polygons from WKT text files or OGR datasources.

Returns a list of Shapely Polygons.

        def load_datasource(datasource, where=None):
    """
    Loads polygons from WKT text files or OGR datasources.

    Returns a list of Shapely Polygons.
    """
    # check if it is a  wkt file
    if os.path.exists(os.path.abspath(datasource)):
        with open(os.path.abspath(datasource), 'r') as fp:
            data = fp.read(50)
        if data.lower().lstrip().startswith(('polygon', 'multipolygon')):
            return load_polygons(datasource)

    # otherwise pass to OGR
    return load_ogr_datasource(datasource, where=where)
        


src/m/a/MapProxy-1.6.0/mapproxy/config/coverage.py   MapProxy(Download)
from mapproxy.srs import SRS
from mapproxy.config import abspath
from mapproxy.util.geom import (
    load_datasource,
    load_ogr_datasource,
                datasource = abspath(datasource, base_path=base_path)
            where = conf.get('where', None)
            geom = load_datasource(datasource, where)
            bbox, geom = build_multipolygon(geom, simplify=True)
    else:

src/m/a/mapproxy-HEAD/mapproxy/config/coverage.py   mapproxy(Download)
from mapproxy.srs import SRS
from mapproxy.config import abspath
from mapproxy.util.geom import (
    load_datasource,
    load_ogr_datasource,
                datasource = abspath(datasource, base_path=base_path)
            where = conf.get('where', None)
            geom = load_datasource(datasource, where)
            bbox, geom = build_multipolygon(geom, simplify=True)
    else: