I am new to arcgis and appreciate any feedback and help 😃
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.
My coding approach (using jupyter notebook), that didn't work##:
# import dependencies
from arcgis.gis import GIS
from arcgis.raster import Raster
from arcgis.raster.analytics import *
# set credentials
gis = GIS(<credentials>)
# load raster image, which is a tiff-file
file_path = r"<path>.tif"
raster_img = Raster(file_path)
# use segment function
# throws error:
: '_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.layers
This lead to a different error:
: 'NoneType' object has no attribute 'update'
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.
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.