當前位置: 首頁>>代碼示例>>Python>>正文


Python WMSSource.extent方法代碼示例

本文整理匯總了Python中mapproxy.source.wms.WMSSource.extent方法的典型用法代碼示例。如果您正苦於以下問題:Python WMSSource.extent方法的具體用法?Python WMSSource.extent怎麽用?Python WMSSource.extent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在mapproxy.source.wms.WMSSource的用法示例。


在下文中一共展示了WMSSource.extent方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: create_wms_source

# 需要導入模塊: from mapproxy.source.wms import WMSSource [as 別名]
# 或者: from mapproxy.source.wms.WMSSource import extent [as 別名]
def create_wms_source(raster_source, app_state):
    url = raster_source.url
    username = raster_source.username
    password = raster_source.password

    http_client = create_http_client(username, password)

    coverage = coverage_from_geojson(raster_source.download_coverage)
    if coverage:
        # wrap to prevent partial tiles
        coverage = AlwaysContainsCoverage(coverage)

    request = create_request({'url': url, 'layers': raster_source.layer}, {}, version='1.1.1')

    image_opts = ImageOptions(resampling='bicubic',
        transparent=True)

    supported_srs = None
    if raster_source.srs != 'EPSG:3857':
        supported_srs = [SRS(raster_source.srs)]

    client = WMSClient(request, http_client=http_client)
    source = WMSSource(client, coverage=coverage,
        supported_srs=supported_srs, image_opts=image_opts,
    )

    # wrap to prevent partial tiles
    source.extent = AlwaysContainsMapExtent(source.extent)
    return source
開發者ID:omniscale,項目名稱:gbi-client,代碼行數:31,代碼來源:mapproxyseed.py


注:本文中的mapproxy.source.wms.WMSSource.extent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。