<jupyter_start><jupyter_text>Performing Data Enrichment The `arcgis.geoanalytics.data_enrichment` submodule contains functions that are used for data enrichment using geoanalytics Table of contents    - [Enrich From Grid](Enrich-From-Grid)- [Calculate Motion Statistics](Calculate-Motion-Statistics)This toolset uses distributed processing to complete analytics on your GeoAnalytics Server.       Tool    Description              enrich_from_grid       The Enrich From Multi-Variable Grid tool joins attributes from a multivariable grid to a point layer.           calculate_motion_statistics      The Calculate Motion Statistics tool calculates motion statistics and descriptors for time-enabled points that represent one or more moving entities. The time-enabled point data must include features 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.<jupyter_code># connect to Enterprise GIS
from arcgis.gis import GIS
import arcgis.geoanalytics

portal_gis = GIS("your_enterprise_profile")
search_result1 = portal_gis.content.search("bigDataFileShares_hurricanes", item_type = "big data file share")[0]
search_result1
search_result2 = portal_gis.content.search("bigDataFileShares_ServiceCallsOrleans", item_type = "big data file share")[0]
search_result2
calls = search_result1.layers[0]
grid_item = portal_gis.content.get('f61cf232eecb49f89a089aedbcc55c51')
grid_item
grid_lyr = grid_item.layers[0]<jupyter_output><empty_output><jupyter_text>Enrich From Grid The [`enrich_from_grid`](https://developers.arcgis.com/rest/services-reference/enterprise/enrich-from-multi-variable-grid.htm) tool joins attributes from a multivariable grid to a point layer. The multivariable grid must be created using the `build_multivariable_grid` task. Metadata from the multivariable grid is used to efficiently enrich the input point features, making it faster than the Join Features task. Attributes in the multivariable grid are joined to the input point features when the features intersect the grid.The attributes in the multivariable grid can be used as explanatory variables when modeling spatial relationships with your input point features, and this task allows you to join those attributes to the point features quickly.<jupyter_code>from arcgis.geoanalytics.data_enrichment import enrich_from_grid
enrich_from_grid(calls, grid_lyr, output_name='enrich from grid test')<jupyter_output>Attaching log redirect
Log level set to DEBUG
Detaching log redirect<jupyter_text>Calculate Motion Statistics The Calculate Motion Statistics tool calculates motion statistics and descriptors for time-enabled points that represent one or more moving entities. The time-enabled point data must include features that represent an instant in time.  Points are grouped together into tracks representing each entity using a unique identifier. Motion statistics are calculated at each point using one or more points in the track history. Calculations include summaries of distance traveled, duration, elevation, speed, acceleration, bearing, and idle status. The result is a new point layer enriched with the requested statistics.For example, a city could be monitoring snowplow operations and want to better understand vehicle movement. The Calculate Motion Statistics tool could be used to determine idle locations, time spent idling, average and maximum speeds over time, total distance covered, and other statistics.<jupyter_code>from arcgis.geoanalytics.data_enrichment import calculate_motion_statistics
hurricanes = search_result2.layers[0]
hurricanes.properties
hurricanes_motion_stats = calculate_motion_statistics(hurricanes, 
                                                      motion_statistics=["speed", 
                                                                         "acceleration", 
                                                                         "bearing"],
                                                      track_fields='track_type',
                                                      track_history_window=5,
                                                      dist_method='Geodesic',
                                                      output_name="Hurricanes_MotionStats")
hurricanes_motion_stats<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.04591368227731864, 'fraction_numerical': 0.006427915518824609, 'mean_word_length': 3.562303664921466, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '308683', 'license': 'Apache-2.0', 'n_tokens_mistral': 1054, 'n_tokens_neox': 976, 'n_words': 412, 'path': 'guide/07-working-with-bigdata/08-performing_data_enrichment.ipynb', 'repo_name': 'MikeTschudi/arcgis-python-api', 'size': '4356'}