<?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: arcgis.geometry.areas_and_lengths() bugged on ArcGIS Online Notebooks? in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-areas-and-lengths-bugged-on-arcgis/m-p/1061034#M6114</link>
    <description>&lt;P&gt;you can access all the tools in arctoolbox if you have arcpy&lt;/P&gt;</description>
    <pubDate>Mon, 24 May 2021 16:56:37 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2021-05-24T16:56:37Z</dc:date>
    <item>
      <title>arcgis.geometry.areas_and_lengths() bugged on ArcGIS Online Notebooks?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-areas-and-lengths-bugged-on-arcgis/m-p/1060709#M6105</link>
      <description>&lt;P&gt;I'm trying to bulk calculate acres for polygons in a hosted feature service using&amp;nbsp;ArcGIS Online Notebook Standard (no ArcPy)&lt;/P&gt;&lt;P&gt;Is there a bug in the ArcGIS Online Notebook (API v1.8.4 at posting time) implementation of the &lt;A href="https://developers.arcgis.com/python/api-reference/1.8.4/arcgis.geometry.html?highlight=arcgis%20geometry%20areas_and_lengths#arcgis.geometry.areas_and_lengths" target="_blank" rel="noopener"&gt;arcgis.geometry.areas_and_lengths()&lt;/A&gt; function or is the API description missing vital information?&lt;/P&gt;&lt;P&gt;Through a lot of trial and error I figured out a set of parameters that ArcGIS Online Notebook would accept&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;For&amp;nbsp;length_unit it will only accept an ID number - e.g. 9002 - not esriSRUnit_Foot&lt;/LI&gt;&lt;LI&gt;For&amp;nbsp;area_unit it will only accept&amp;nbsp; a dictionary&amp;nbsp; - e.g.&amp;nbsp;{"areaUnit" : "esriAcres"} - not an ID number or&amp;nbsp;esriAcres&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I could only get it to work with parameters formatted the following way:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.geometry import lengths, areas_and_lengths, project
from arcgis.geometry import Point, Polyline, Polygon, Geometry

# create a JSON polygon geometry 
geom_json = {"rings" : [[[0, 0], [0, 10], [10, 10],[10, 0],[0, 0]]],
            "spatialReference" : {"wkid" : 4326}}
# create Geometry object 
test_geom = Geometry(geom_json)
# calculate areas_and_lengths
areas_and_lengths(test_geom, 9035, {"areaUnit" : "esriAcres"}, "geodesic", 4326, None, False)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I welcome any suggestions on a more efficient way to calculate acres than one by one converting a Feature into a Geometry to then run&amp;nbsp;areas_and_lengths().&lt;BR /&gt;Without using ArcPy though&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;edit: fixed typos&lt;/P&gt;</description>
      <pubDate>Sat, 22 May 2021 01:05:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-areas-and-lengths-bugged-on-arcgis/m-p/1060709#M6105</guid>
      <dc:creator>Wolfgang_Grunberg_AZ_DFFM</dc:creator>
      <dc:date>2021-05-22T01:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: arcgis.geometry.areas_and_lengths() bugged on ArcGIS Online Notebooks?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-areas-and-lengths-bugged-on-arcgis/m-p/1060714#M6106</link>
      <description>&lt;P&gt;Perhaps raise an "issue" on their github site... they don't visit much here.&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-python-api" target="_self"&gt;ArcGIS API for Python (github.com)&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 22 May 2021 02:27:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-areas-and-lengths-bugged-on-arcgis/m-p/1060714#M6106</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-05-22T02:27:02Z</dc:date>
    </item>
    <item>
      <title>Re: arcgis.geometry.areas_and_lengths() bugged on ArcGIS Online Notebooks?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-areas-and-lengths-bugged-on-arcgis/m-p/1060971#M6112</link>
      <description>&lt;P&gt;Thx &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/215600"&gt;@DanPatterson&lt;/a&gt;! Posted a &lt;A href="https://github.com/Esri/arcgis-python-api/issues/1011" target="_self"&gt;bug report on github&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;BTW: do you have any suggestions on a better way to bulk calculate feature acres in Esri Python API? Perhaps even with ArcPy?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 May 2021 14:51:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-areas-and-lengths-bugged-on-arcgis/m-p/1060971#M6112</guid>
      <dc:creator>Wolfgang_Grunberg_AZ_DFFM</dc:creator>
      <dc:date>2021-05-24T14:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: arcgis.geometry.areas_and_lengths() bugged on ArcGIS Online Notebooks?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-areas-and-lengths-bugged-on-arcgis/m-p/1061034#M6114</link>
      <description>&lt;P&gt;you can access all the tools in arctoolbox if you have arcpy&lt;/P&gt;</description>
      <pubDate>Mon, 24 May 2021 16:56:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-areas-and-lengths-bugged-on-arcgis/m-p/1061034#M6114</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-05-24T16:56:37Z</dc:date>
    </item>
  </channel>
</rss>

