Skip to content

intro to feature analysis guide#2526

Open
ManushiM wants to merge 4 commits into
masterfrom
intro_to_feature_analysis
Open

intro to feature analysis guide#2526
ManushiM wants to merge 4 commits into
masterfrom
intro_to_feature_analysis

Conversation

@ManushiM

@ManushiM ManushiM commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

closes https://github.com/ArcGIS/geosaurus/issues/13316


Checklist

Please go through each entry in the below checklist and mark an 'X' if that condition has been met. Every entry should be marked with an 'X' to be get the Pull Request approved.

  • All imports are in the first cell?
    • First block of imports are standard libraries
    • Second block are 3rd party libraries
    • Third block are all arcgis imports? Note that in some cases, for samples, it is a good idea to keep the imports next to where they are used, particularly for uncommonly used features that we want to highlight.
  • All GIS object instantiations are one of the following?
    • gis = GIS()
    • gis = GIS('home') or gis = GIS('pro')
    • gis = GIS(profile="your_online_portal")
    • gis = GIS(profile="your_enterprise_portal")
  • If this notebook requires setup or teardown, did you add the appropriate code to ./misc/setup.py and/or ./misc/teardown.py?
  • If this notebook references any portal items that need to be staged on AGOL/Python API playground, did you coordinate with a Python API team member to stage the item the correct way with the api_data_owner user?
  • If the notebook requires working with local data (such as CSV, FGDB, SHP, Raster files), upload the files as items to the Geosaurus Online Org using api_data_owner account and change the notebook to first download and unpack the files.
  • Code simplified & split out across multiple cells, useful comments?
  • Consistent voice/tense/narrative style? Thoroughly checked for typos?
  • All images used like <img src="base64str_here"> instead of <img src="https://some.url">? All map widgets contain a static image preview? (Call mapview_inst.take_screenshot() to do so)
  • All file paths are constructed in an OS-agnostic fashion with os.path.join()? (Instead of r"\foo\bar", os.path.join(os.path.sep, "foo", "bar"), etc.)
  • Is your code formatted using Jupyter Black? You can use Jupyter Black to format your code in the notebook.
  • If this notebook showcases deep learning capabilities, please go through the following checklist:
    • Are the inputs required for Export Training Data Using Deep Learning tool published on geosaurus org (api data owner account) and added in the notebook using gis.content.get function?
    • Is training data zipped and published as Image Collection? Note: Whole folder is zipped with name same as the notebook name.
    • Are the inputs required for model inferencing published on geosaurus org (api data owner account) and added in the notebook using gis.content.get function? Note: This includes providing test raster and trained model.
    • Are the inferenced results displayed using a webmap widget?
  • IF YOU WANT THIS SAMPLE TO BE DISPLAYED ON THE DEVELOPERS.ARCGIS.COM WEBSITE, ping @jyaistMap so he can add it to the list for the next deploy.

@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@@ -0,0 +1,321 @@
{

@nanaeaubry nanaeaubry Jul 9, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feature analysis is the process of performing server-side spatial analysis operations on feature data, such as points, lines, and polygons. These operations can be used to find features, merge or overlay features, calculate statistics, and identify patterns or relationships in feature data. The operation you choose depends on the problem you are trying to solve.

Feature analysis can help solve different types of spatial problems. For example, you can use it to:

  • Understand where features are located or where multiple features exist.
  • Measure the size, shape, and distribution of features.
  • Analyze relationships and interactions between features.
  • Detect and quantify patterns in feature data.
  • Make predictions based on existing or theoretical patterns and relationships.


Reply via ReviewNB

@@ -0,0 +1,321 @@
{

@nanaeaubry nanaeaubry Jul 9, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To perform feature analysis, you can use a hosted feature layer as input to an analysis tool. The feature analysis service accesses the hosted data, executes the operation, and stores the result as either a hosted feature layer or an in-memory feature collection.

In the ArcGIS API for Python, feature analysis tools are available in the features.analysis module and other features submodules. Unless otherwise noted in the API reference for a specific tool, analysis tools support the following input formats:

  1. FeatureCollection — An in-memory collection of Feature objects with rendering information.
  2. FeatureLayer — An individual layer in a feature service.
  3. FeatureLayerCollection — A collection of feature layers and tables that represents a feature service in the Python API.
  4. Item — An item of type FeatureCollection or FeatureLayerCollection. Only the first layer is used.

Feature analysis tools usually return one of the following output formats, unless otherwise noted for a specific tool:

  1. FeatureLayer — A hosted feature layer in the ArcGIS organization you are authenticated to. This is returned when output_name is provided.
  2. FeatureCollection — An in-memory result that can be accessed directly.


Reply via ReviewNB

@@ -0,0 +1,321 @@
{

@nanaeaubry nanaeaubry Jul 9, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let’s look at an example that finds specific data of interest, identifies hot spots within that data, and displays the analysis results on a map.


Reply via ReviewNB

@@ -0,0 +1,321 @@
{

@nanaeaubry nanaeaubry Jul 9, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gis = GIS(profile = 'your_online_profile')

This is extremely nitpick but below you add spaces between parameters, the equal sign, and the value.


Reply via ReviewNB

@@ -0,0 +1,321 @@
{

@nanaeaubry nanaeaubry Jul 9, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We access crime incident data for Washington, DC, for the first half of 2026 using the item ID of the feature layer collection.

or maybe FeatureLayerCollection ? The next statement down you do FeatureLayer so it would follow same format.


Reply via ReviewNB

@@ -0,0 +1,321 @@
{

@nanaeaubry nanaeaubry Jul 9, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We verify that a FeatureLayer object was extracted from the item. Then, we run the tool and provide the name to use for the output layer that will be created in our GIS organization.


Reply via ReviewNB

@@ -0,0 +1,321 @@
{

@nanaeaubry nanaeaubry Jul 9, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add code comments:

# Create a map centered on Washington DC
map1 = gis.map("Washington, DC")

# Add results and change basemap
map1.content.add(hot_spots_result)
map1.basemap.basemap = 'arcgis-dark-gray'

# Display
map1

Reply via ReviewNB

@@ -0,0 +1,321 @@
{

@nanaeaubry nanaeaubry Jul 9, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feature analysis tools provide an easy and effective way to analyze data hosted in your Web GIS organization.

To learn more, explore the following feature analysis guides and samples.

Guides:

.

.

.

Samples:

.

.

.


Reply via ReviewNB

@nanaeaubry

Copy link
Copy Markdown
Contributor

@ManushiM The code looks good in the guide but I left comments on the wording. Feel free to change as you see fit. I just found the language to be a bit colloquial at times for a guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants