在全息视图中访问底层图块图像

Accessing the underlying tile image in holoviews

是否可以从 hv.element.tiles.EsriImagery() 访问底层图像?我想访问图块图像和上面的 运行 对象检测模型。

当我尝试访问 .data 属性 时,我看到模板 url https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{Z}/{Y}/{X}.jpg,但是我有兴趣访问特定图块的图像正在显示,然后将其用于其他处理。

是的,这是可能的,我们就有这样的例子!它尚未完全发布,但可以在 https://github.com/pyviz-topics/examples/pull/193 获得源代码。相关函数在 GeoViews (geoviews/util.py):

def get_tile_rgb(tile_source, bbox, zoom_level, bbox_crs=ccrs.PlateCarree()):
    """
    Returns an RGB element given a tile_source, bounding box and zoom level.

    Parameters
    ----------
    tile_source: WMTS element or string URL
      The tile source to download the tiles from.
    bbox: tuple
      A four tuple specifying the (left, bottom, right, top) corners of the
      domain to download the tiles for.
    zoom_level: int
      The zoom level at which to download the tiles
    bbox_crs: ccrs.CRs
      cartopy CRS defining the coordinate system of the supplied bbox

    Returns
    -------
    RGB element containing the tile data in the specified bbox
    """