在 ipyleaflet 中映射南极极地立体数据

Mapping Antarctic Polar Stereographic data in ipyleaflet

我正在尝试使用 ipyleaflet 绘制南极海冰 EPSG:3031 数据,如下所示:


from ipyleaflet import Map, WMSLayer, basemaps

wms = WMSLayer(
    url='http://geos.polarview.aq/geoserver/wms',
    layers='polarview:iceedgeS15',
    format='image/png',
    transparent=True,
    attribution='Polarview'
)

m = Map(basemap=basemaps.NASAGIBS.BlueMarble3031, center=(-90, 0), zoom=1, crs=projections.EPSG3031)

m.add_layer(wms)

m

以下链接中的照片清楚地说明了我的问题:

The data and the basemap do not align

如果我省略底图和投影信息,它看起来 reasonable in terms of alignment but doesn't have the perspective and projection I desire. I have been also been using Leafmap 将本地 geotiffs 和 运行 添加到类似问题中。

我已经阅读了一些相关的内容PRs and checked out xarray-leaflet but haven't had any luck. This sea-ice concentration data 是一个非 wms 数据源的示例,我遇到了同样的问题,可能有助于测试目的。

好问题。 您需要将坐标参考系统 (CRS) 信息添加到 WMSLayer。请参阅 ipyleaflet 示例中的 custom projections notebook。对于非 Web 墨卡托 (EPSG:3857) 的空间投影,您可能需要定义图像的边界。

    from ipyleaflet import Map, WMSLayer, basemaps

    # create map with NASA Blue Marble as background
    m2 = Map(basemap=basemaps.NASAGIBS.BlueMarble3031,
         center=(-90, 0), zoom=1, crs=projections.EPSG3031)

    # projection for Polarview sea ice edge
    POLAR3031 = dict(
        name='EPSG:3031',
        custom=True,
        proj4def="""+proj=stere +lat_0=-90 +lat_ts=-71 +lon_0=0 +k=1
            +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs""",
        bounds=[[-2822131.5,-3057369.25],[3744213.75,3822194.25]]
    )
    wms = WMSLayer(
        url='http://geos.polarview.aq/geoserver/wms',
        layers='polarview:iceedgeS15',
        format='image/png',
        transparent=True,
        attribution='Polarview',
        crs=POLAR3031
    )
    m2.add(wms)

    # show map
    m2