<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Python Summzarize_within attribute error? in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/python-summzarize-within-attribute-error/m-p/815096#M2646</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/372824"&gt;Garas Lewis&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for reaching&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt; out with your ques&lt;/SPAN&gt;tions regarding GeoAnalytics Server tools.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, I'll clarify why summary_polygons is an optional parameter. Note that the tool Summarize Within has two options for aggregation:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Aggregate by polygons - In this case the polygon layer is required and bin parameters are not&lt;/LI&gt;&lt;LI&gt;Aggregate&amp;nbsp;by bins - In this case the bin type and bin size parameters are required, and summary polygons are not&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;So, the summary_polygons parameter is optional since choosing to summarize into bins does not require a summary_polygons layer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second, let's solve the error &lt;SPAN style="background-color: #ffffff;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b22b31; background-color: #ffffff; border: 0px; font-weight: bold;"&gt;AttributeError&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt;: 'Item' object has no attribute 'summarize_within')&amp;nbsp;&lt;/SPAN&gt;when trying to run your ArcGIS Python API script. It looks like your code is trying to call the tool from the webmap (like "webmap.summarize_within"), but it should be calling it from the geoanalytics module (like "geoanalytics.summarize_within").&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before we move onto fixing up the scripts, it's important to note that there are a few ways to run Summarize Within:&lt;/P&gt;&lt;DIV&gt;&lt;OL&gt;&lt;LI&gt;In ArcGIS Online using&amp;nbsp;the ArcGIS API for Python. See the documentation and examples here: &lt;A class="link-titled" href="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.features.analysis.html?highlight=summarize%20within#arcgis.features.analysis.summarize_within" title="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.features.analysis.html?highlight=summarize%20within#arcgis.features.analysis.summarize_within"&gt;arcgis.features.analysis module — arcgis 1.6.2 documentation&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;In ArcGIS Enterprise using standard analysis tools or GeoAnalytics tools. GeoAnalytics tools require a GeoAnalytics Server.&lt;/LI&gt;&lt;LI&gt;Using the same tools through arcpy (GeoAnalytics tools or standard tools)&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have outlined each of these methods below, but please ask me if for further clarification if you are still unsure which one you should be using!&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Solution 1)&amp;nbsp;In ArcGIS Online using&amp;nbsp;the ArcGIS API&amp;nbsp;for Python&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Below is a sample script to get the ArcGIS Online tool working using the ArcGIS Python API. For more help, see the documentation here:&amp;nbsp;&lt;A class="link-titled" href="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.features.analysis.html?highlight=summarize%20within#arcgis.features.analysis.summarize_within" title="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.features.analysis.html?highlight=summarize%20within#arcgis.features.analysis.summarize_within"&gt;arcgis.features.analysis module — arcgis 1.6.2 documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&lt;SPAN&gt;# Run the&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;ArcGIS Online tool&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;tool using ArcGIS&amp;nbsp;Python API scripting&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# Import modules&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;from arcgis.gis import GIS&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;from arcgis.features.summarize_data import summarize_within&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# Use your Online connection to specify where you want to run the tool&lt;BR /&gt;gis = GIS("https://www.arcgis.com/home/", "your_username", "your.password")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# Set the parameters to run the ArcGIS Online Summarize Within tool with&lt;BR /&gt;sum_within_layer = "https://services1.arcgis.com/abc123/arcgis/rest/services/Drought Affected Shires/FeatureServer/0"&lt;BR /&gt;summary_layer = "https://services1.arcgis.com/abc123/arcgis/rest/services/QFESFireStations/FeatureServer/0"&lt;BR /&gt;output_name = "SEE_ME_arcgisOnline_pythonAPI"&lt;BR /&gt;sum_shape=True&lt;BR /&gt;shape_units=None&lt;BR /&gt;summary_fields=[]&lt;BR /&gt;group_by_field=None&lt;BR /&gt;minority_majority=False&lt;BR /&gt;percent_shape=False&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# Run the ArcGIS Online Summarize Within tool&lt;BR /&gt;summarized_result = summarize_within(sum_within_layer, summary_layer, sum_shape, shape_units, summary_fields, &lt;BR /&gt; group_by_field, minority_majority, percent_shape, &lt;BR /&gt; output_name)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Solution 2)&amp;nbsp;In ArcGIS Enterprise using standard analysis tools or GeoAnalytics tools.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Below is a sample script to get the GeoAnalytics tool working using the ArcGIS Python API. For more help, see the documentation here:&amp;nbsp;&lt;A class="link-titled" href="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.geoanalytics.summarize_data.html#summarize-within" title="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.geoanalytics.summarize_data.html#summarize-within"&gt;arcgis.geoanalytics.summarize_data module — arcgis 1.6.2 documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&lt;SPAN&gt;# Run the&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;ArcGIS Enterprise tool&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;tool using ArcGIS&amp;nbsp;Python API scripting&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# Import modules&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;import arcgis&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;from arcgis.gis import GIS&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# Import the GeoAnalytics Server tool you want to run&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;from arcgis.geoanalytics.summarize_data import summarize_within&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# Use your Portal connection to specify where you want to run the tool&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;gis = GIS("https://&amp;lt;my_domain&amp;gt;.com/portal", "your_username", "your.password")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# Check that your Portal is GeoAnalytics enabled&lt;BR /&gt;# If this returns false, please see the end of this post for a standard analysis solution!&lt;BR /&gt;check_geoanalytics = arcgis.geoanalytics.is_supported()&lt;BR /&gt;print("The check for GeoAnalytics returned {}".format(check_geoanalytics))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# Set tool variables &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;summarized_layer = "https://&amp;lt;my_domain&amp;gt;.com/server/rest/services/Hosted/QFESFireStations/0" &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;summary_polygons = "https://&amp;lt;my_domain&amp;gt;.com/server/rest/services/Hosted/Drought Affected Shires/0" &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;output_name = "SEE_ME_geoanalytics_pythonAPI"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# Run the tool using the ArcGIS Python API&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;summarize_result = summarize_within(summarized_layer, summary_polygons,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; bin_type=None,bin_size=None, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; bin_size_unit=None, standard_summary_fields=None, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; weighted_summary_fields=None, sum_shape=False, shape_units=None,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; group_by_field=None, minority_majority=False, percent_shape=False,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; output_name)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;To get the scripts above to work, you will have to replace the URL with your domain and double check that the rest endpoints for the layers are correct.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; font-family: arial, helvetica, sans-serif; "&gt;Solution 3)&amp;nbsp;&lt;STRONG&gt;Using the same tools through arcpy (GeoAnalytics tools or standard tools)&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Finally, to solve the arcpy error &lt;SPAN style="background-color: #ffffff;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b22b31; background-color: #ffffff; border: 0px; font-weight: bold;"&gt;RuntimeError&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt;: Object: Error in executing tool),&amp;nbsp;&lt;/SPAN&gt;you can modify&amp;nbsp;and run the sample scripts provided below&amp;nbsp;in your ArcGIS Pro python environment. This should solve the error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you intended to use the&amp;nbsp;ArcGIS Enterprise GeoAnalytics tool via arcpy, below is a sample script to complete the workflow. For more information, see the documentation here: &lt;A href="https://pro.arcgis.com/en/pro-app/tool-reference/big-data-analytics/summarize-within.htm:"&gt;https://pro.arcgis.com/en/pro-app/tool-reference/big-data-analytics/summarize-within.htm&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# Run the&amp;nbsp;&lt;SPAN&gt;GeoAnalytics&lt;/SPAN&gt; tool using ArcGIS Pro arcpy scripting&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# import modules&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;from arcpy import geoanalytics&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# Set the parameters you want to use in the GeoAnalytics Server tool &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;summarized_layer = "QFESFireStations"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;summary_polygons = "Drought Affected Shires; QLD"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;output_name = "SEE_ME_geoanalytics_arcpy"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;polygon_or_bin = "POLYGON"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# Run the GeoAnalytics Server tool using arcpy &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;summarize_result = arcpy.geoanalytics.SummarizeWithin(summarized_layer, output_name, polygon_or_bin, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;'', None, summary_polygons, "NO_SUMMARY", '', None, None, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;"SPATIOTEMPORAL_DATA_STORE", None, "NO_MIN_MAJ", None)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you intended to use the&amp;nbsp;ArcGIS Enterprise Standard&amp;nbsp;tool via arcpy, here is a sample script to complete the workflow. For more information, see the documentation here:&amp;nbsp;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/tool-reference/feature-analysis/summarize-within.htm" title="https://pro.arcgis.com/en/pro-app/tool-reference/feature-analysis/summarize-within.htm"&gt;Summarize Within—Standard Feature Analysis tools | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# Run the&amp;nbsp;Standard&amp;nbsp;tool using ArcGIS Pro arcpy scripting&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# Import modules&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;import arcpy&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;from arcpy import sfa&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# Set the parameters you want to use in the standard analysis&amp;nbsp;tool&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;summarized_layer = "https://&amp;lt;my_domain&amp;gt;.com/server/rest/services/Hosted/QFESFireStations/0"&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;summary_polygons = "https://&amp;lt;my_domain&amp;gt;.com/server/rest/services/Hosted/Drought Affected Shires/0"&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# Run the standard analysis tool via arcpy&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;summarize_result = arcpy.sfa.SummarizeWithin(summary_polygons, summarized_layer, "SEE_ME_standardAnalysis_arcpy", "ADD_SHAPE_SUM", '', None, None, "NO_MIN_MAJ", "NO_PERCENT")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the above scripts to work, you&amp;nbsp;may have to replace summarized_layer and summary_polygons with full URL pathways to the layer, like in&amp;nbsp;solution 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if you have any questions regarding these scripts, or anything else related to your workflow. I hope this helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Bethany&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Oct 2019 22:48:27 GMT</pubDate>
    <dc:creator>BethanyScott</dc:creator>
    <dc:date>2019-10-16T22:48:27Z</dc:date>
    <item>
      <title>Python Summzarize_within attribute error?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/python-summzarize-within-attribute-error/m-p/815095#M2645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In arcgis online i have a webmap where i did a sumamrize within of a bunch of points into polygons to give those polygons density colours based on the number of points that are within them, now I want to do the same thing but solely in python. my points are the &lt;SPAN&gt;"QFESFireStations"&lt;/SPAN&gt;&lt;SPAN&gt;, and my polygons are the &lt;SPAN&gt;"Drought Affected Shires; QLD". My code is below. Also, I dont get why the summary_polygons layer is optional, because the tool NEEDS two layers, so how can only one layer be required for an input??? See the links below.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For some reason when i run this below i get (&lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;AttributeError&lt;/SPAN&gt;: 'Item' object has no attribute 'summarize_within')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from arcgis.geoanalytics.summarize_data import summarize_within&lt;BR /&gt;webmap.summarize_within(summarized_layer="QFESFireStations", output_name = "SEE_ME", &lt;BR /&gt; polygon_or_bin = "POLYGONS", bin_type = "SQUARE", &lt;BR /&gt; summary_polygons="Drought Affected Shires; QLD", sum_shape = True)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;A href="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.geoanalytics.summarize_data.html#summarize-within"&gt;https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.geoanalytics.summarize_data.html#summarize-within&lt;/A&gt;&lt;/P&gt;&lt;P&gt;----------------------------------------------------------&lt;/P&gt;&lt;P&gt;Also, this is just a note&amp;nbsp;I have three variable types&lt;/P&gt;&lt;P&gt;webmap = item&lt;BR /&gt;NewWebMap = MapView&amp;nbsp;&lt;BR /&gt;usable = WebMap&lt;/P&gt;&lt;P&gt;---------------------------------------------------------&lt;/P&gt;&lt;P&gt;I tried the samething using arcpy but also didnt work.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;# https://pro.arcgis.com/en/pro-app/tool-reference/big-data-analytics/summarize-within.htm&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;BR /&gt;drought = gis.content.get('4e73c854013a43beb258150d4be7e135')&lt;BR /&gt;Fire_station = gis.content.get('84fead439e2444a299d75296c365aba7')&lt;BR /&gt;outFS = 'SEE_ME1'&lt;BR /&gt;dataStore = "SEE_ME_DataStore1"&lt;/P&gt;&lt;P&gt;# Execute SummarizeWithin&lt;BR /&gt;arcpy.geoanalytics.SummarizeWithin(Fire_station, outFS, "POLYGON", None, None, drought, "ADD_SUMMARY", dataStore)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This gives the error (&lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;RuntimeError&lt;/SPAN&gt;: Object: Error in executing tool)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Oct 2019 22:25:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/python-summzarize-within-attribute-error/m-p/815095#M2645</guid>
      <dc:creator>GarasLewis</dc:creator>
      <dc:date>2019-10-15T22:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: Python Summzarize_within attribute error?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/python-summzarize-within-attribute-error/m-p/815096#M2646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/372824"&gt;Garas Lewis&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for reaching&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt; out with your ques&lt;/SPAN&gt;tions regarding GeoAnalytics Server tools.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, I'll clarify why summary_polygons is an optional parameter. Note that the tool Summarize Within has two options for aggregation:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Aggregate by polygons - In this case the polygon layer is required and bin parameters are not&lt;/LI&gt;&lt;LI&gt;Aggregate&amp;nbsp;by bins - In this case the bin type and bin size parameters are required, and summary polygons are not&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;So, the summary_polygons parameter is optional since choosing to summarize into bins does not require a summary_polygons layer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second, let's solve the error &lt;SPAN style="background-color: #ffffff;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b22b31; background-color: #ffffff; border: 0px; font-weight: bold;"&gt;AttributeError&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt;: 'Item' object has no attribute 'summarize_within')&amp;nbsp;&lt;/SPAN&gt;when trying to run your ArcGIS Python API script. It looks like your code is trying to call the tool from the webmap (like "webmap.summarize_within"), but it should be calling it from the geoanalytics module (like "geoanalytics.summarize_within").&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before we move onto fixing up the scripts, it's important to note that there are a few ways to run Summarize Within:&lt;/P&gt;&lt;DIV&gt;&lt;OL&gt;&lt;LI&gt;In ArcGIS Online using&amp;nbsp;the ArcGIS API for Python. See the documentation and examples here: &lt;A class="link-titled" href="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.features.analysis.html?highlight=summarize%20within#arcgis.features.analysis.summarize_within" title="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.features.analysis.html?highlight=summarize%20within#arcgis.features.analysis.summarize_within"&gt;arcgis.features.analysis module — arcgis 1.6.2 documentation&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;In ArcGIS Enterprise using standard analysis tools or GeoAnalytics tools. GeoAnalytics tools require a GeoAnalytics Server.&lt;/LI&gt;&lt;LI&gt;Using the same tools through arcpy (GeoAnalytics tools or standard tools)&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have outlined each of these methods below, but please ask me if for further clarification if you are still unsure which one you should be using!&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Solution 1)&amp;nbsp;In ArcGIS Online using&amp;nbsp;the ArcGIS API&amp;nbsp;for Python&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Below is a sample script to get the ArcGIS Online tool working using the ArcGIS Python API. For more help, see the documentation here:&amp;nbsp;&lt;A class="link-titled" href="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.features.analysis.html?highlight=summarize%20within#arcgis.features.analysis.summarize_within" title="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.features.analysis.html?highlight=summarize%20within#arcgis.features.analysis.summarize_within"&gt;arcgis.features.analysis module — arcgis 1.6.2 documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&lt;SPAN&gt;# Run the&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;ArcGIS Online tool&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;tool using ArcGIS&amp;nbsp;Python API scripting&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# Import modules&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;from arcgis.gis import GIS&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;from arcgis.features.summarize_data import summarize_within&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# Use your Online connection to specify where you want to run the tool&lt;BR /&gt;gis = GIS("https://www.arcgis.com/home/", "your_username", "your.password")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# Set the parameters to run the ArcGIS Online Summarize Within tool with&lt;BR /&gt;sum_within_layer = "https://services1.arcgis.com/abc123/arcgis/rest/services/Drought Affected Shires/FeatureServer/0"&lt;BR /&gt;summary_layer = "https://services1.arcgis.com/abc123/arcgis/rest/services/QFESFireStations/FeatureServer/0"&lt;BR /&gt;output_name = "SEE_ME_arcgisOnline_pythonAPI"&lt;BR /&gt;sum_shape=True&lt;BR /&gt;shape_units=None&lt;BR /&gt;summary_fields=[]&lt;BR /&gt;group_by_field=None&lt;BR /&gt;minority_majority=False&lt;BR /&gt;percent_shape=False&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# Run the ArcGIS Online Summarize Within tool&lt;BR /&gt;summarized_result = summarize_within(sum_within_layer, summary_layer, sum_shape, shape_units, summary_fields, &lt;BR /&gt; group_by_field, minority_majority, percent_shape, &lt;BR /&gt; output_name)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Solution 2)&amp;nbsp;In ArcGIS Enterprise using standard analysis tools or GeoAnalytics tools.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Below is a sample script to get the GeoAnalytics tool working using the ArcGIS Python API. For more help, see the documentation here:&amp;nbsp;&lt;A class="link-titled" href="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.geoanalytics.summarize_data.html#summarize-within" title="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.geoanalytics.summarize_data.html#summarize-within"&gt;arcgis.geoanalytics.summarize_data module — arcgis 1.6.2 documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&lt;SPAN&gt;# Run the&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;ArcGIS Enterprise tool&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;tool using ArcGIS&amp;nbsp;Python API scripting&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# Import modules&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;import arcgis&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;from arcgis.gis import GIS&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# Import the GeoAnalytics Server tool you want to run&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;from arcgis.geoanalytics.summarize_data import summarize_within&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# Use your Portal connection to specify where you want to run the tool&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;gis = GIS("https://&amp;lt;my_domain&amp;gt;.com/portal", "your_username", "your.password")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# Check that your Portal is GeoAnalytics enabled&lt;BR /&gt;# If this returns false, please see the end of this post for a standard analysis solution!&lt;BR /&gt;check_geoanalytics = arcgis.geoanalytics.is_supported()&lt;BR /&gt;print("The check for GeoAnalytics returned {}".format(check_geoanalytics))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# Set tool variables &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;summarized_layer = "https://&amp;lt;my_domain&amp;gt;.com/server/rest/services/Hosted/QFESFireStations/0" &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;summary_polygons = "https://&amp;lt;my_domain&amp;gt;.com/server/rest/services/Hosted/Drought Affected Shires/0" &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;output_name = "SEE_ME_geoanalytics_pythonAPI"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# Run the tool using the ArcGIS Python API&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;summarize_result = summarize_within(summarized_layer, summary_polygons,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; bin_type=None,bin_size=None, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; bin_size_unit=None, standard_summary_fields=None, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; weighted_summary_fields=None, sum_shape=False, shape_units=None,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; group_by_field=None, minority_majority=False, percent_shape=False,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; output_name)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;To get the scripts above to work, you will have to replace the URL with your domain and double check that the rest endpoints for the layers are correct.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; font-family: arial, helvetica, sans-serif; "&gt;Solution 3)&amp;nbsp;&lt;STRONG&gt;Using the same tools through arcpy (GeoAnalytics tools or standard tools)&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Finally, to solve the arcpy error &lt;SPAN style="background-color: #ffffff;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b22b31; background-color: #ffffff; border: 0px; font-weight: bold;"&gt;RuntimeError&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt;: Object: Error in executing tool),&amp;nbsp;&lt;/SPAN&gt;you can modify&amp;nbsp;and run the sample scripts provided below&amp;nbsp;in your ArcGIS Pro python environment. This should solve the error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you intended to use the&amp;nbsp;ArcGIS Enterprise GeoAnalytics tool via arcpy, below is a sample script to complete the workflow. For more information, see the documentation here: &lt;A href="https://pro.arcgis.com/en/pro-app/tool-reference/big-data-analytics/summarize-within.htm:"&gt;https://pro.arcgis.com/en/pro-app/tool-reference/big-data-analytics/summarize-within.htm&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# Run the&amp;nbsp;&lt;SPAN&gt;GeoAnalytics&lt;/SPAN&gt; tool using ArcGIS Pro arcpy scripting&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# import modules&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;from arcpy import geoanalytics&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# Set the parameters you want to use in the GeoAnalytics Server tool &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;summarized_layer = "QFESFireStations"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;summary_polygons = "Drought Affected Shires; QLD"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;output_name = "SEE_ME_geoanalytics_arcpy"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;polygon_or_bin = "POLYGON"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# Run the GeoAnalytics Server tool using arcpy &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;summarize_result = arcpy.geoanalytics.SummarizeWithin(summarized_layer, output_name, polygon_or_bin, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;'', None, summary_polygons, "NO_SUMMARY", '', None, None, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;"SPATIOTEMPORAL_DATA_STORE", None, "NO_MIN_MAJ", None)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you intended to use the&amp;nbsp;ArcGIS Enterprise Standard&amp;nbsp;tool via arcpy, here is a sample script to complete the workflow. For more information, see the documentation here:&amp;nbsp;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/tool-reference/feature-analysis/summarize-within.htm" title="https://pro.arcgis.com/en/pro-app/tool-reference/feature-analysis/summarize-within.htm"&gt;Summarize Within—Standard Feature Analysis tools | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# Run the&amp;nbsp;Standard&amp;nbsp;tool using ArcGIS Pro arcpy scripting&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# Import modules&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;import arcpy&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;from arcpy import sfa&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# Set the parameters you want to use in the standard analysis&amp;nbsp;tool&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;summarized_layer = "https://&amp;lt;my_domain&amp;gt;.com/server/rest/services/Hosted/QFESFireStations/0"&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;summary_polygons = "https://&amp;lt;my_domain&amp;gt;.com/server/rest/services/Hosted/Drought Affected Shires/0"&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;# Run the standard analysis tool via arcpy&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;summarize_result = arcpy.sfa.SummarizeWithin(summary_polygons, summarized_layer, "SEE_ME_standardAnalysis_arcpy", "ADD_SHAPE_SUM", '', None, None, "NO_MIN_MAJ", "NO_PERCENT")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the above scripts to work, you&amp;nbsp;may have to replace summarized_layer and summary_polygons with full URL pathways to the layer, like in&amp;nbsp;solution 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if you have any questions regarding these scripts, or anything else related to your workflow. I hope this helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Bethany&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Oct 2019 22:48:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/python-summzarize-within-attribute-error/m-p/815096#M2646</guid>
      <dc:creator>BethanyScott</dc:creator>
      <dc:date>2019-10-16T22:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: Python Summzarize_within attribute error?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/python-summzarize-within-attribute-error/m-p/815097#M2647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;Thank you so much!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also justed wanted to ask:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;how do i add another layer and change when it turns on based on zoom? Like if i zoom out I want a layer to deactivate(hide), and when i zoom in i want to be able to see it again. Like i have a bunch of layers here for example and i dont want the map to be cluttered. And how do i get the legend to appear, i found ".legend" but it doesn't work?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;WebMap = gis.map('Queensland')&lt;BR /&gt;WebMap.add_layer(analysis_layer)&lt;BR /&gt;WebMap.add_layer(point_layer)&lt;BR /&gt;WebMap.legend = True&lt;BR /&gt;WebMap&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(2)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to aggregate points? for example if i have a point layer with lots of points can i merge those points together based on some distance? for that layer?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--------------------------NOTES FOR OTHERS-----------------------------&lt;/P&gt;&lt;P&gt;Heres a couple more points I just learned to add.&lt;/P&gt;&lt;P&gt;(1)&lt;/P&gt;&lt;P&gt;#&amp;nbsp;Change a&amp;nbsp;mapserver layer to a featurelayer in case someone needs to know how&lt;/P&gt;&lt;P&gt;&lt;EM&gt;from arcgis.features import FeatureLayer&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;drought_polygons = FeatureLayer(url="https://gisservices.information.qld.gov.au/arcgis/rest/services/Farming/DroughtDeclarations/MapServer/0")&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much AGAIN!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2019 04:09:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/python-summzarize-within-attribute-error/m-p/815097#M2647</guid>
      <dc:creator>GarasLewis</dc:creator>
      <dc:date>2019-10-17T04:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: Python Summzarize_within attribute error?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/python-summzarize-within-attribute-error/m-p/815098#M2648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/372824"&gt;Garas Lewis&lt;/A&gt;‌!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm happy to see the scripts were helpful.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The best steps&amp;nbsp;to get the appropriate answers to your follow up questions would be:&lt;BR /&gt;&amp;nbsp;- Please open two new GeoNet questions; one with each of the questions you asked above. I work with GeoAnalytics analysis, but someone from the appropriate part of the software will be glad to help answer your new questions. &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- In your new question 1, could you please clarify if you are using the Python API for scripting, and where you are trying to make the legend visible (i.e. in a custom app, in Jupyter notebooks, etc)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Feel free to post links to your new questions in this thread so we can forward them on to the correct contact. &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bethany&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Oct 2019 19:56:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/python-summzarize-within-attribute-error/m-p/815098#M2648</guid>
      <dc:creator>BethanyScott</dc:creator>
      <dc:date>2019-10-21T19:56:36Z</dc:date>
    </item>
  </channel>
</rss>

