Analyzing patterns in feature data

Your web GIS packs a set of tools that help you identify, quantify, and visualize spatial patterns in your data by identifying areas of statistically significant clusters.

This section demonstrates how interpolate_points() can be used to convert point feature data representing measurements in spot locations into a continuous prediction surface.

Interpolate points

The 'interpolate points' tool allows you to predict values at new locations based on measurements from a collection of points. The prediction result is a polygon layer classified by predicted values. We will use this tool to create a rainfall prediction surface using data from sparse weather stations in Chennai.

# Connect to GIS
from arcgis.gis import GIS
# you can use either your enterprise profile or your online profile
gis = GIS(profile="your_online_profile")
chennai_rainfall = gis.content.search("title:chennai_rain type:Feature Service")[0]
map1 = gis.map("Tamil Nadu")

Draw the rainfall stations on a map rendered by rainfall quantity

map1.content.add(chennai_rainfall)
map1

image-chennai-rainfall.png

renderer_manager = map1.content.renderer(0)
smart_map_manager = renderer_manager.smart_mapping()
smart_map_manager.class_breaks_renderer(break_type="size", field="RAINFALL")

The analyze_patterns sub module in features module provides access to interpolate_points() method.

from arcgis.features.analyze_patterns import interpolate_points

#run the interpolation tool and specify the field containing rainfall data
interpolated_rf = interpolate_points(chennai_rainfall, field='RAINFALL')
{"cost": 0.119}

The interpolate_points() method accepts more optional parameters allowing you to customize the analysis task. Using those parameters, you could optionally limit the number of classes generated, specify the class breaks, etc.

If the output_name parameter is not specified, the tool creates a feature collection instead of creating an output feature layer.

Let us add the result to a new map

interpolated_map = gis.map("Tamil Nadu")
interpolated_map.content.add(interpolated_rf['result_layer'])
interpolated_map

image-interpolated-layer.png

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

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close