POST
|
Yeah, it was just a copying issue. Should have been ecd_file = r"<path>\Preview_Segmented_TrainIsoCl.ecd"
... View more
10-13-2020
06:17 PM
|
0
|
1
|
465
|
POST
|
The function arcpy.sa.Functions.ClassifyRaster(in_raster, in_classifier_definition, in_additional_raster='#') is giving me the error RuntimeError: Object: Error in executing tool. I set up the example analogue to Raster klassifizieren—Hilfe | ArcGIS for Desktop . You can see the code in the following: import arcgis from arcgis.gis import GIS from arcgis.raster import Raster import arcpy from arcpy.sa import * from arcgis.raster.functions import * from arcgis.raster.analytics import * arcpy.CheckOutExtension("Spatial") file_path = r"<path>.tif" raster_test = Raster(file_path) test_img = segment_mean_shift(raster_test, spectral_detail=None, spatial_detail=None, spectral_radius=None, spatial_radius=None, min_num_pixels_per_segment=None) # file generated through graphical interface, because python code is not working as well ecd_file = f"<path>/Preview_Segmented_TrainIsoCl.ecd" ClassifyRaster(in_raster=test_img, in_classifier_definition=ecd_file) I appreciate any help in solving this issue 😃
... View more
10-12-2020
04:17 AM
|
0
|
3
|
516
|
POST
|
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.
... View more
10-12-2020
04:01 AM
|
0
|
0
|
554
|
POST
|
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 import arcgis 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 segment(input_raster=raster_img) # throws error: AttributeError: '_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] This lead to a different error: AttributeError: 'NoneType' object has no attribute 'update'
... View more
10-11-2020
08:54 AM
|
0
|
1
|
602
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|