交互式WMSG(Web地图磁贴服务)#

此示例演示了OGC Web服务Web地图切片服务(WMSG)感知轴支持的交互式平移和缩放功能。

示例WMSG层是2012年4月9天和2012年10月13天内采样的数据的单一组合,显示了地球的夜间情况。它不会随着时间的推移而变化。

该图像由美国国家海洋和大气管理局(NOAA)运营的Suomi国家极轨合作伙伴关系(Suomi NPP)气象卫星收集。

Suomi NPP Earth at night April/October 2012
/xpy/lib/python3.13/site-packages/owslib/wmts.py:861: FutureWarning: Truth-testing of elements was a source of confusion and will always return True in future versions. Use specific 'len(elem)' or 'elem is not None' test instead.
  if current and current.text == 'true':
/xpy/lib/python3.13/site-packages/owslib/wmts.py:658: RuntimeWarning: TileMatrixLimits with tileMatrix "1" already exists
  warnings.warn(msg, RuntimeWarning)
/xpy/lib/python3.13/site-packages/owslib/wmts.py:658: RuntimeWarning: TileMatrixLimits with tileMatrix "2" already exists
  warnings.warn(msg, RuntimeWarning)
/xpy/lib/python3.13/site-packages/owslib/wmts.py:658: RuntimeWarning: TileMatrixLimits with tileMatrix "3" already exists
  warnings.warn(msg, RuntimeWarning)
/xpy/lib/python3.13/site-packages/owslib/wmts.py:658: RuntimeWarning: TileMatrixLimits with tileMatrix "4" already exists
  warnings.warn(msg, RuntimeWarning)
/xpy/lib/python3.13/site-packages/owslib/wmts.py:658: RuntimeWarning: TileMatrixLimits with tileMatrix "5" already exists
  warnings.warn(msg, RuntimeWarning)
/xpy/lib/python3.13/site-packages/owslib/wmts.py:658: RuntimeWarning: TileMatrixLimits with tileMatrix "6" already exists
  warnings.warn(msg, RuntimeWarning)

import matplotlib.pyplot as plt

import cartopy.crs as ccrs


def main():
    url = 'https://map1c.vis.earthdata.nasa.gov/wmts-geo/wmts.cgi'
    layer = 'VIIRS_CityLights_2012'

    fig = plt.figure()
    ax = fig.add_subplot(1, 1, 1, projection=ccrs.PlateCarree())
    ax.add_wmts(url, layer)
    ax.set_extent([-15, 25, 35, 60], crs=ccrs.PlateCarree())

    ax.set_title('Suomi NPP Earth at night April/October 2012')
    plt.show()


if __name__ == '__main__':
    main()

Total running time of the script: (0分7.635秒)

Gallery generated by Sphinx-Gallery _