Use Proximity

The arcgis.geoanalytics.summarize_data submodule contains functions that calculate total counts, lengths, areas, and basic descriptive statistics of features and their attributes within areas or near other features.

This toolset uses distributed processing to complete analytics on your GeoAnalytics Server.

Tool

Description

create_buffers

The Create Buffers tool creates areas around input point, line, or area features to a specified distance.

trace_proximity_events

The Trace Proximity Events tool traces events near each other in space (location) and time. The input layer must be time-enabled points that represent an instant in time.

Note: The purpose of the notebook is to show examples of the different tools that can be run on an example dataset.

# connect to Enterprise GIS
from arcgis.gis import GIS
import arcgis.geoanalytics
gis = GIS()
portal_gis = GIS("your_enterprise_portal")

Search items to run your analysis

search_result1 = gis.content.get("8e46fd0d3cd8452696fcd6baaab2df6f")
search_result1
PUSD Schools
Schools in the Pasadena Unified School DistrictFeature Layer Collection by Learn_ArcGIS
Last Modified: October 17, 2018
0 comments, 53,217 views
search_result2 = gis.content.get("5183636f099c48789628226e5730fb13")
search_result2
Traffic Collisions
Traffic collisions in Pasadena, California, since 2008.Feature Layer Collection by api_data_owner
Last Modified: April 26, 2019
0 comments, 0 views
schools = search_result1.layers[0]
collisions = search_result2.layers[0]

Create Buffers

The create_buffers tool creates areas around input point, line, or area features to a specified distance.

Buffers are typically used to create areas that can be further analyzed using other tools, like aggregate_points. For example, when asking the question, “Which buildings are within one mile of the school?”, we can derive the answer 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 the buildings within one mile of the school.

from arcgis.geoanalytics.use_proximity import create_buffers
create_buffers(input_layer=schools, 
               output_name='buffered_areas_around_schools',
               distance=1,
               distance_unit='Kilometers')

image.png

Trace Proximity Events

The Trace Proximity Events tool traces events near each other in space (location) and time. The input layer must be of time-enabled points that represent an instant in time.

The trace_proximity_events task analyzes time-enabled point features representing moving entities. The task will follow entities of interest in space (location) and time to see which other entities the entities of interest have interacted with. The trace will continue from entity to entity to a configurable maximum degrees of separation from the original entity of interest.

For example, suppose an organization monitors company-issued devices carried by workers. The company is interested in determining which employees were near an individual known to have COVID-19. Using the point layer representing device locations by time, the organization can identify devices that have been within 6 meters and 5 minutes of the contagious person, as well as other possibly contagious employees.

As another example, an NGO is monitoring salmon populations using GPS and is interested in tracking the spread of salmon lice between escaped farmed salmon and wild populations. Some GPS-tagged farmed salmon could then be tracked to see if they came into close proximity with any tagged wild populations. The NGO could then follow those wild populations that may further spread the disease. The measurements could also include a depth field, allowing the NGO to use the attributeMatchCriteria parameter to only find fish at a similar depth.

from arcgis.geoanalytics.use_proximity import trace_proximity_events
trace_contacts = trace_proximity_events(input_points=seatle_example_tracks,
                                        entity_id_field='user_id',
                                        entities_of_interest_ids='user3',
                                        spatial_search_distance=2,
                                        spatial_search_distance_unit='Meters',
                                        temporal_search_distance=10,
                                        temporal_search_distance_unit='Minutes',
                                        output_name='trace contacts')

image.png

In this guide, we learned about about proximity tools. In the next guide, we will learn about the data enrichment module.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.