本文整理汇总了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