# arcgis.geoanalytics.use_proximity module¶

These tools help answer one of the most common questions posed in spatial analysis: What is near what?

create_buffers() creates areas of a specified distance from features.

## create_buffers¶

arcgis.geoanalytics.use_proximity.create_buffers(input_layer, distance: float = 1, distance_unit: str = 'Miles', field: str = None, method: str = 'Planar', dissolve_option: str = 'None', dissolve_fields: str = None, summary_fields: str = None, multipart: bool = False, output_name: str = None, context: str = None, gis=None, future=False) Buffers are typically used to create areas that can be further analyzed using other tools such as aggregate_points. For example, ask the question, “What buildings are within one mile of the school?” The answer can be found by creating a one-mile buffer around the school and overlaying the buffer with the layer containing building footprints. The end result is a layer of those buildings within one mile of the school.

Parameter

Description

input_layer

Required layer. The point, line, or polygon features to be buffered. See Feature Input.

distance (Required if field is not provided)

Optional float. A float value used to buffer the input features. You must supply a value for either the distance or field parameter. You can only enter a single distance value. The units of the distance value are supplied by the distance_unit parameter.

The default value is 1.

distance_unit (Required if distance is used)

Optional string. The linear unit to be used with the value specified in distance.

Choice list:[‘Feet’, ‘Yards’, ‘Miles’, ‘Meters’, ‘Kilometers’, ‘NauticalMiles’]

The default value is “Miles”

field (Required if distance not provided)

Optional string. A field on the input_layer containing a buffer distance or a field expression. A buffer expression must begin with an equal sign (=). To learn more about buffer expressions see: Buffer Expressions

method

Optional string. The method used to apply the buffer with. There are two methods to choose from:

Choice list:[‘Geodesic’, ‘Planar’]

• Planar - This method applies a Euclidean buffers and is appropriate for local analysis on projected data. This is the default.

• Geodesic - This method is appropriate for large areas and any geographic coordinate system.

dissolve_option

Optional string. Determines how output polygon attributes are processed.

Choice list:[‘All’, ‘List’, ‘None’]

 Value Description All - All features are dissolved into one feature. You can calculate summary statistics and determine if you want multipart or single part features. List - Features with the same value in the specified field will be dissolve together. You can calculate summary statistics and determine if you want multipart or single part features. None - No features are dissolved. There are no additional dissolve options.

dissolve_fields

Specifies the fields to dissolve on. Multiple fields may be provided.

summary_fields

Optional string. A list of field names and statistical summary types that you want to calculate for resulting polygons. Summary statistics are only available if dissolveOption = List or All. By default, all statistics are returned.

Example: [{“statisticType”: “statistic type”, “onStatisticField”: “field name”}, ..}]

fieldName is the name of the fields 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 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

Optional boolean. Determines if output features are multipart or single part. This option is only available if a dissolve_option is applied.

output_name

Optional string. The task will create a feature service of the results. You define the name of the service.

gis

Optional, the GIS on which this tool runs. If not specified, the active GIS is used.

context

Optional dict. The context parameter contains additional settings that affect task execution. For this task, there are four settings:

1. Extent (extent) - A bounding box that defines the analysis area. Only those features that intersect the bounding box will be analyzed.

2. Processing spatial reference (processSR) - The features will be projected into this coordinate system for analysis.

3. Output spatial reference (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.

4. Data store (dataStore) - Results will be saved to the specified data store. The default is the spatiotemporal big data store.

future

Optional boolean. If ‘True’, the value is returned as a GPJob.

The default value is ‘False’

Returns

Output Features as a feature layer collection item

# 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')
{"ft_lang_label":"__label__en","ft_lang_prob":0.762972,"math_prob":0.91042024,"size":5504,"snap":"2020-45-2020-50","text_gpt3_token_len":1180,"char_repetition_ratio":0.13018182,"word_repetition_ratio":0.07372176,"special_character_ratio":0.20657703,"punctuation_ratio":0.13931888,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9606207,"pos_list":[0,1,2],"im_url_duplicate_count":[null,2,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-10-28T14:28:52Z\",\"WARC-Record-ID\":\"<urn:uuid:a2c92aaa-16fa-4c71-a630-67158aeb3026>\",\"Content-Length\":\"22814\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:9f658052-927a-48e9-88d4-ba6009c10e52>\",\"WARC-Concurrent-To\":\"<urn:uuid:efa0ddd7-b230-47dc-9cdf-4d57d59ddfcb>\",\"WARC-IP-Address\":\"13.32.207.47\",\"WARC-Target-URI\":\"https://developers.arcgis.com/python/api-reference/arcgis.geoanalytics.use_proximity.html\",\"WARC-Payload-Digest\":\"sha1:WD2XMKUI3UNRAHR6TXZNL3FV2D7PNAOS\",\"WARC-Block-Digest\":\"sha1:MLOXGMHVQBM3RCNFYBMR7X7JFEWQ5IPJ\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-45/CC-MAIN-2020-45_segments_1603107898577.79_warc_CC-MAIN-20201028132718-20201028162718-00446.warc.gz\"}"}