本文簡要介紹 python 語言中 arcgis.raster.RasterCollection.map
的用法。
用法:
map(func, context=None)
返回:
在每個項目上應用 func 後,從現有的
RasterCollection
創建一個新的RasterCollection
。
map
方法將 Python 函數映射到柵格集合上。Parameter
Description
func
必需的。用於映射柵格集合的 Python 函數。函數的返回值必須是其中一個鍵是光柵的字典。例如,{“raster”:output_raster_object、“name”:input_item_name[“name”]}。
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: This snippet maps grayscale function to each raster item in the raster collection. rc_local = RasterCollection(r"./data/rasters.gdb/rasters") def apply_grayscale(item): raster = item["Raster"] gray = grayscale(raster) return {"raster": gray, "Name": item["Name"], "StdTime": item["AcquisitionDate"]} gray_rc = rc_local.map(func=apply_grayscale)
相關用法
- Python ArcGIS RasterCollection.filter_by_raster_property用法及代碼示例
- Python ArcGIS RasterCollection.filter_by_time用法及代碼示例
- Python ArcGIS RasterCollection.filter_by_geometry用法及代碼示例
- Python ArcGIS RasterCollection.from_stac_catalog用法及代碼示例
- Python ArcGIS RasterCollection.filter_by_calendar_range用法及代碼示例
- Python ArcGIS RasterCollection.filter_by_attribute用法及代碼示例
- Python ArcGIS RasterCollection.filter_by用法及代碼示例
- Python ArcGIS RasterCollection.to_multidimensional_raster用法及代碼示例
- Python ArcGIS RasterCollection.from_stac_api用法及代碼示例
- Python ArcGIS RasterCollection用法及代碼示例
- Python ArcGIS Raster.remove_variables用法及代碼示例
- Python ArcGIS Raster.export_image用法及代碼示例
- Python ArcGIS Raster.get_dimension_values用法及代碼示例
- Python ArcGIS Raster.get_dimension_attributes用法及代碼示例
- Python ArcGIS Raster.read用法及代碼示例
- Python ArcGIS Raster.append_slices用法及代碼示例
- Python ArcGIS Raster.summarize用法及代碼示例
- Python ArcGIS RasterManager.add用法及代碼示例
- Python ArcGIS Raster.get_variable_attributes用法及代碼示例
- Python ArcGIS Raster.get_dimension_names用法及代碼示例
- Python ArcGIS RasterInfo.from_dict用法及代碼示例
- Python ArcGIS Raster.get_statistics用法及代碼示例
- Python ArcGIS Raster.from_stac_item用法及代碼示例
- Python ArcGIS Raster.set_colormap用法及代碼示例
- Python ArcGIS Raster.set_histograms用法及代碼示例
注:本文由純淨天空篩選整理自arcgis.com大神的英文原創作品 arcgis.raster.RasterCollection.map。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。