當前位置: 首頁>>代碼示例 >>用法及示例精選 >>正文


Python ArcGIS RasterCollection.filter_by_geometry用法及代碼示例


本文簡要介紹 python 語言中 arcgis.raster.RasterCollection.filter_by_geometry 的用法。

用法:

filter_by_geometry(query_geometry_or_extent, context=None)

返回:

僅包含滿足過濾器的項目的 RasterCollection 對象

filter_by_geometry 方法過濾 RasterCollection,以便僅返回與幾何圖形相交的柵格。

Parameter

Description

query_geometry_or_extent

過濾項目的必需對象,以便僅返回與對象相交的項目。這可以通過幾何對象、光柵對象、ImageryLayer 對象來指定。

context

可選字典。用於控製 RasterCollection 創建的其他屬性。上下文參數的默認值將與應用於父集合的上下文設置的默認值相同。

目前可用:

  • query_boundary: This boolean value set to this option determines whether to add SHAPE field to the RasterCollection. The value in the SHAPE field represents the boundary/geometry of the raster. The query_boundary parameter is honoured only when the RasterCollection is created from a list of Rasters.

    • True: Set query_boundary to True to add the SHAPE field to the RasterCollection.

    • False: Set query_boundary to False to not add the SHAPE field to the RasterCollection. (Creation of RasterCollection would be faster)

    Example:

    {“query_boundary”:True}

例子:

# Usage Example: Filters the raster collection based on specified geometry.

aoi = {
        "spatialReference": {"wkid": 32610},
        "xmax": 725000,
        "xmin": 720000,
        "ymax": 4300000,
        "ymin": 4250000
      }

aoi_geometry = Geometry(aoi)

filtered_rc_geom = rc.filter_by_geometry(query_geometry_or_extent=aoi_geometry)

相關用法


注:本文由純淨天空篩選整理自arcgis.com大神的英文原創作品 arcgis.raster.RasterCollection.filter_by_geometry。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。