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


Python ArcGIS create_buffers用法及代碼示例

本文簡要介紹 python 語言中 arcgis.geoanalytics.use_proximity.create_buffers 的用法。

用法:

arcgis.geoanalytics.use_proximity.create_buffers(input_layer, distance=None, distance_unit=None, field=None, method='Planar', dissolve_option='None', dissolve_fields=None, summary_fields=None, multipart=False, output_name=None, context=None, gis=None, future=False)

返回:

FeatureLayerCollection

create_buffers_geo.png

緩衝區通常用於創建可以使用其他工具(例如 aggregate_points )進一步分析的區域。例如,問一個問題:“學校一英裏範圍內有哪些建築物?”答案可以通過在學校周圍創建一個one-mile 緩衝區並將緩衝區與包含建築物足跡的圖層覆蓋來找到。最終結果是學校一英裏內的這些建築物的一層。

Parameter

Description

input_layer

必需的層。要緩衝的點、線或麵要素。請參閱特征輸入。

距離(如果未提供字段,則為必需)

可選浮點數。用於緩衝輸入要素的浮點值。您必須為距離或字段參數提供一個值。您隻能輸入一個距離值。距離值的單位由distance_unit 參數提供。

field 為 None 時,默認值為 1。

distance_unit(如果使用距離則需要)

可選字符串。與距離中指定的值一起使用的線性單位。

選擇清單:

  • Feet

  • Yards

  • Miles

  • Meters

  • Kilometers

  • NauticalMiles

field為None時,默認值為Miles

字段(如果未提供距離,則為必填項)

可選字符串。 input_layer 上包含緩衝距離或字段表達式的字段。緩衝區表達式必須以等號 (=) 開頭。要了解有關緩衝區表達式的更多信息,請參閱:Buffer Expressions

method

可選字符串。用於應用緩衝區的方法。有兩種方法可供選擇:

選擇列表:['測地線','平麵']

  • Planar - 此方法應用歐幾裏德緩衝區,適用於投影數據的本地分析。這是默認設置。

  • Geodesic - 此方法適用於大麵積區域和任何地理坐標係。

dissolve_option

可選字符串。確定如何處理輸出多邊形屬性。

選擇清單:

  • All

  • List

  • None

Value

Description

All - 所有函數都分解為一個函數。

您可以計算匯總統計數據並確定是否需要多部分或單部分函數。

List - 指定字段中具有相同值的要素將被溶解在一起。

您可以計算匯總統計數據並確定是否需要多部分或單部分函數。

None - 沒有函數被溶解。

沒有其他溶解選項。

dissolve_fields

指定要溶解的字段。可以提供多個字段。

summary_fields

可選字符串。要為生成的多邊形計算的字段名稱和統計匯總類型的列表。僅當溶解選項 = 列表或全部時,匯總統計才可用。默認情況下,返回所有統計信息。

例子:[{"statisticType": "statistic type", "onStatisticField": "field name"}]

  • onStatisticField is the name of the field in the input point layer.

  • statisticType is one of the following for numeric fields:

    • Count - Totals the number of values of all the points in each polygon.

    • Sum - Adds the total value of all the points in each polygon.

    • Mean - Calculates the average of all the points in each polygon.

    • Min - Finds the smallest value of all the points in each polygon.

    • Max - Finds the largest value of all the points in each polygon.

    • Range - Finds the difference between the Min and Max values.

    • Stddev - Finds the standard deviation of all the points in each polygon.

    • Var - Finds the variance of all the points in each polygon.

  • statisticType is one of the following for string fields:

    • Count - Totals the number of strings for all the points in each polygon.

    • Any - Returns a sample string of a point in each polygon.

multipart

可選的布爾值。確定輸出要素是多部分還是單部分。此選項僅在應用dissolve_option 時可用。

output_name

可選字符串。該任務將創建結果的要素服務。您定義服務的名稱。

gis

可選,運行此工具的 GIS 。如果未指定,則使用活動 GIS。

context

可選字典。 context 參數包含影響任務執行的其他設置。對於此任務,有四個設置:

  • extent - A bounding box that defines the analysis area. Only those features that intersect the bounding box will be analyzed.

  • processSR - The features will be projected into this coordinate system for analysis.

  • outSR - The features will be projected into this coordinate system after the analysis to be saved. The output spatial reference for the spatiotemporal big data store is always WGS84.

  • dataStore - Results will be saved to the specified data store. For ArcGIS Enterprise, the default is the spatiotemporal big data store.

future

可選布爾值。如果是 True ,則該值作為 GPJob 返回。

默認值為False

例子:

# Usage Example: To create buffer based on distance field.

buffer = create_buffers(input_layer=lyr,
                        field='dist',
                        method='Geodesic',
                        dissolve_option='All',
                        dissolve_fields='Date')

相關用法


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