<?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: How to segment raster data? in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-segment-raster-data/m-p/851567#M3861</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So, I found a solution for the .tif raster file(1st example) - using arcgis.raster.functions.segment_mean_shift() works properly. The input data type was apparently a reason for the segment() function to not work. &lt;BR /&gt;Nevertheless, I still don't see why the example above didn't work for the imagery input type example (2nd one) or how to convert imagery layer data into raster data and vice versa.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Oct 2020 11:01:14 GMT</pubDate>
    <dc:creator>KarenSchulz</dc:creator>
    <dc:date>2020-10-12T11:01:14Z</dc:date>
    <item>
      <title>How to segment raster data?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-segment-raster-data/m-p/851566#M3860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am new to arcgis and appreciate any feedback and help &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;My aim: I would like to segment a raster image through the python api in the same manner as it is possible with the graphical interface. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My coding approach (using jupyter notebook), that didn't work##:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# import dependencies&lt;BR /&gt;import arcgis&lt;BR /&gt;from arcgis.gis import GIS&lt;BR /&gt;from arcgis.raster import Raster&lt;BR /&gt;from arcgis.raster.analytics import *&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# set credentials&lt;/P&gt;&lt;P&gt;gis = GIS(&amp;lt;credentials&amp;gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# load raster image, which is a tiff-file&lt;/P&gt;&lt;P&gt;file_path = r"&amp;lt;path&amp;gt;.tif"&lt;BR /&gt;raster_img = Raster(file_path)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# use segment function&lt;/P&gt;&lt;P&gt;segment(input_raster=raster_img)&lt;/P&gt;&lt;P&gt;# throws error:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN class="" style="box-sizing: border-box; color: #b22b31; font-weight: bold;"&gt;AttributeError&lt;/SPAN&gt;: '_ArcpyRaster' object has no attribute '_engine_obj'

Also tried using a different image from the online resources:
items2 = gis.content.search("title: multispectral landsat", item_type="Imagery Layer", outside_org=True) 
landsat_layer = items2[0].layers[0]&lt;/PRE&gt;&lt;P&gt;This lead to a different error:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN class="" style="box-sizing: border-box; color: #b22b31; font-weight: bold;"&gt;AttributeError&lt;/SPAN&gt;: 'NoneType' object has no attribute 'update'&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:29:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-segment-raster-data/m-p/851566#M3860</guid>
      <dc:creator>KarenSchulz</dc:creator>
      <dc:date>2021-12-12T10:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to segment raster data?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-segment-raster-data/m-p/851567#M3861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So, I found a solution for the .tif raster file(1st example) - using arcgis.raster.functions.segment_mean_shift() works properly. The input data type was apparently a reason for the segment() function to not work. &lt;BR /&gt;Nevertheless, I still don't see why the example above didn't work for the imagery input type example (2nd one) or how to convert imagery layer data into raster data and vice versa.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2020 11:01:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-segment-raster-data/m-p/851567#M3861</guid>
      <dc:creator>KarenSchulz</dc:creator>
      <dc:date>2020-10-12T11:01:14Z</dc:date>
    </item>
  </channel>
</rss>

