本文整理匯總了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