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


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


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

用法:

filter_by_raster_property(property_name, operator, property_values, context=None)

返回:

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

filter_by_raster_property 方法通過柵格屬性查詢過濾 RasterCollection,並返回僅包含滿足查詢的項目的 RasterCollection

Parameter

Description

property_name

必需的字符串。要在過濾器中使用的屬性的名稱。

operator

必需的字符串。過濾屬性的關鍵字。關鍵字包括以下內容:

  • CONTAINS - The attribute in the field contains the specified string, list, or number.

  • ENDS_WITH - The attribute ends with the specified string or number.

  • EQUALS - The attribute equals the specified string, list, or number.

  • GREATER_THAN - The attribute is greater than the specified number.

  • IN - The attribute is one of the items in the specified list.

  • LESS_THAN - The attribute is less than the specified number.

  • NOT_CONTAINS - The attribute does not contain the specified string, list, or number.

  • NOT_ENDS_WITH - The attribute does not end with the specified string or number.

  • NOT_EQUALS - The attribute does not equal the specified string, list, or number.

  • NOT_GREATER_THAN - The attribute is not greater than the specified number.

  • NOT_IN - The attribute is not one of the items in the specified list.

  • NOT_LESS_THAN - The attribute is not less than the specified number.

  • NOT_STARTS_WITH - The attribute does not start with the specified string or number.

  • STARTS_WITH - The attribute starts with the specified string or number.

property_values

必需的對象。要比較的一個或多個屬性值。這可以指定為字符串、列表或數字。

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 out rasters with a band count of 3 from the raster collection

filtered_rc = rc.filter_by_raster_property(property_name="BAND_COUNT",
                                           operator="EQUALS",
                                           property_values=3)

相關用法


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