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

All Samples(14)  |  Call(8)  |  Derive(0)  |  Import(6)

        def load_coverage(conf, base_path=None):
    if 'ogr_datasource' in conf:
        require_geom_support()
        srs = conf['ogr_srs']
        datasource = conf['ogr_datasource']
        if not re.match(r'^\w{2,}:', datasource):
            # looks like a file and not PG:, MYSQL:, etc
            # make absolute path
            datasource = abspath(datasource, base_path=base_path)
        where = conf.get('ogr_where', None)
        geom = load_ogr_datasource(datasource, where)
        bbox, geom = build_multipolygon(geom, simplify=True)
    elif 'polygons' in conf:
        require_geom_support()
        srs = conf['polygons_srs']
        geom = load_polygons(abspath(conf['polygons'], base_path=base_path))
        bbox, geom = build_multipolygon(geom, simplify=True)
    elif 'bbox' in conf:
        srs = conf.get('bbox_srs') or conf['srs']
        bbox = conf['bbox']
        if isinstance(bbox, basestring):
            bbox = map(float, bbox.split(','))
        geom = None
    elif 'datasource' in conf:
        require_geom_support()
        datasource = conf['datasource']
        srs = conf['srs']
        if isinstance(datasource, (list, tuple)):
            bbox = datasource
            geom = None
        elif bbox_string_re.match(datasource):
            bbox = map(float, datasource.split(','))
            geom = None
        else:
            if not re.match(r'^\w{2,}:', datasource):
                # looks like a file and not PG:, MYSQL:, etc
                # make absolute path
                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:
        return None
    return coverage(geom or bbox, SRS(srs))
        


src/m/a/MapProxy-1.6.0/mapproxy/script/export.py   MapProxy(Download)
 
from mapproxy.srs import SRS
from mapproxy.config.coverage import load_coverage
from mapproxy.config.loader import (
    load_configuration, ConfigurationError,
    if options.coverage:
        seed_coverage = load_coverage(
            {'datasource': options.coverage, 'srs': srs, 'where': options.where},
            base_path=os.getcwd())
    else:

src/m/a/mapproxy-HEAD/mapproxy/script/export.py   mapproxy(Download)
 
from mapproxy.srs import SRS
from mapproxy.config.coverage import load_coverage
from mapproxy.config.loader import (
    load_configuration, ConfigurationError,
    if options.coverage:
        seed_coverage = load_coverage(
            {'datasource': options.coverage, 'srs': srs, 'where': options.where},
            base_path=os.getcwd())
    else:

src/m/a/MapProxy-1.6.0/mapproxy/config/loader.py   MapProxy(Download)
    def coverage(self):
        if not 'coverage' in self.conf: return None
        from mapproxy.config.coverage import load_coverage
        return load_coverage(self.conf['coverage'])
 

src/m/a/mapproxy-HEAD/mapproxy/config/loader.py   mapproxy(Download)
    def coverage(self):
        if not 'coverage' in self.conf: return None
        from mapproxy.config.coverage import load_coverage
        return load_coverage(self.conf['coverage'])
 

src/m/a/MapProxy-1.6.0/mapproxy/seed/config.py   MapProxy(Download)
from mapproxy.config import abspath
from mapproxy.config.loader import ConfigurationError
from mapproxy.config.coverage import load_coverage
from mapproxy.srs import SRS
from mapproxy.util.py import memoize
            for view in options['views']:
                view_conf = self.conf['views'][view]
                coverage = load_coverage(view_conf)
 
                cache_srs = view_conf.get('srs', None)
                name, ','.join((self.conf.get('coverages') or {}).keys())))
 
        return load_coverage(coverage_conf)
 
    def cache(self, cache_name):

src/m/a/mapproxy-HEAD/mapproxy/seed/config.py   mapproxy(Download)
from mapproxy.config import abspath
from mapproxy.config.loader import ConfigurationError
from mapproxy.config.coverage import load_coverage
from mapproxy.srs import SRS
from mapproxy.util.py import memoize
            for view in options['views']:
                view_conf = self.conf['views'][view]
                coverage = load_coverage(view_conf)
 
                cache_srs = view_conf.get('srs', None)
                name, ','.join((self.conf.get('coverages') or {}).keys())))
 
        return load_coverage(coverage_conf)
 
    def cache(self, cache_name):