<?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: Calculate max value on feature layer in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/calculate-max-value-on-feature-layer/m-p/1058360#M6067</link>
    <description>&lt;P&gt;Hello!&lt;BR /&gt;I was able to do it with out_statistics:&lt;BR /&gt;&lt;BR /&gt;max_value = feature_layer.query(out_fields='id', out_statistics=[{"statisticType":"max", "onStatisticField": "id", "outStatisticFieldName": "maxid"}])&lt;BR /&gt;for record in max_value:&lt;BR /&gt;print(record.get_value("maxid"))&lt;/P&gt;&lt;P&gt;Wasn't sure how to do it beacause I'm still learning how to deal with the api, but It's done and it is faster than creating a spatialdataframe.&lt;BR /&gt;Thanks for your help!&lt;/P&gt;</description>
    <pubDate>Sun, 16 May 2021 21:45:25 GMT</pubDate>
    <dc:creator>Jose_FranciscoSánchez_Díaz1</dc:creator>
    <dc:date>2021-05-16T21:45:25Z</dc:date>
    <item>
      <title>Calculate max value on feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/calculate-max-value-on-feature-layer/m-p/1058282#M6064</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I'm tryng to get the max value on a feature layer using argis python api.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to check the max record on a numeric field.&lt;BR /&gt;I&amp;nbsp;was able to get it loading the feature layer to a spatial dataframe, but it is slow and will become slower once the feature layer grow (I spect to reach near a million records).&lt;/P&gt;&lt;P&gt;I think it is possible with the fearurelayer metho, but I don know how to do it.&lt;/P&gt;&lt;P&gt;My actual code:&lt;BR /&gt;&lt;BR /&gt;sdf = pd.DataFrame.spatial.from_layer(feature_layer_hosted_on_arcgis)&lt;BR /&gt;id = sdf["id"]&lt;BR /&gt;max_value = id.max()&lt;/P&gt;</description>
      <pubDate>Sat, 15 May 2021 11:12:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/calculate-max-value-on-feature-layer/m-p/1058282#M6064</guid>
      <dc:creator>Jose_FranciscoSánchez_Díaz1</dc:creator>
      <dc:date>2021-05-15T11:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate max value on feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/calculate-max-value-on-feature-layer/m-p/1058283#M6065</link>
      <description>&lt;P&gt;If you go to the FeatureLayer heading&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.features.toc.html" target="_blank"&gt;arcgis.features module — arcgis 1.8.5 documentation&lt;/A&gt;&amp;nbsp;there is a query() method with an&amp;nbsp;&lt;SPAN&gt;out_statistics parameter (min,max etc.).&amp;nbsp; This may be faster.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 15 May 2021 11:22:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/calculate-max-value-on-feature-layer/m-p/1058283#M6065</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2021-05-15T11:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate max value on feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/calculate-max-value-on-feature-layer/m-p/1058287#M6066</link>
      <description>&lt;P&gt;Have you triedfeaturelayer.query with "&lt;SPAN&gt;out_statistics&lt;/SPAN&gt;"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ming&lt;/P&gt;</description>
      <pubDate>Sat, 15 May 2021 12:07:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/calculate-max-value-on-feature-layer/m-p/1058287#M6066</guid>
      <dc:creator>MingHome</dc:creator>
      <dc:date>2021-05-15T12:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate max value on feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/calculate-max-value-on-feature-layer/m-p/1058360#M6067</link>
      <description>&lt;P&gt;Hello!&lt;BR /&gt;I was able to do it with out_statistics:&lt;BR /&gt;&lt;BR /&gt;max_value = feature_layer.query(out_fields='id', out_statistics=[{"statisticType":"max", "onStatisticField": "id", "outStatisticFieldName": "maxid"}])&lt;BR /&gt;for record in max_value:&lt;BR /&gt;print(record.get_value("maxid"))&lt;/P&gt;&lt;P&gt;Wasn't sure how to do it beacause I'm still learning how to deal with the api, but It's done and it is faster than creating a spatialdataframe.&lt;BR /&gt;Thanks for your help!&lt;/P&gt;</description>
      <pubDate>Sun, 16 May 2021 21:45:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/calculate-max-value-on-feature-layer/m-p/1058360#M6067</guid>
      <dc:creator>Jose_FranciscoSánchez_Díaz1</dc:creator>
      <dc:date>2021-05-16T21:45:25Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate max value on feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/calculate-max-value-on-feature-layer/m-p/1059277#M6084</link>
      <description>&lt;P&gt;Excellent, thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 19 May 2021 02:07:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/calculate-max-value-on-feature-layer/m-p/1059277#M6084</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-05-19T02:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate max value on feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/calculate-max-value-on-feature-layer/m-p/1397562#M9779</link>
      <description>&lt;P&gt;Thank you for posting the solution that worked for you - that's a big help!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2024 22:37:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/calculate-max-value-on-feature-layer/m-p/1397562#M9779</guid>
      <dc:creator>alex_friant</dc:creator>
      <dc:date>2024-03-18T22:37:11Z</dc:date>
    </item>
  </channel>
</rss>

