POST
|
HI all, I was trying to work with one of the jupyter notebooks from Esri/ arcgis-python-api hosted in Github and I got the following exception: Exception: Unable to complete operation. Invalid band index. (Error Code: 400), in the last block of code. The jupyter notebook building_a_change_detection_app_using_jupyter_dashboard, runs correctly with no errors, but when clicking in the widget "Detect changes" created with the last cell of code it returns the previous exception mentioned. Any idea of how to solve this would be very appreciated # create the action button diffbtn = widgets.Button(description='Detect changes' ,disabled=False ,button_style='success' ,tooltip= 'Show Different Image' ,icon='check') def on_diffbutton_clicked(b): # m.clear_graphics() first = df.iloc[oldslider.value].OBJECTID last = df.iloc[newslider.value].OBJECTID old = landsat.filter_by('OBJECTID='+str(first)) new = landsat.filter_by('OBJECTID='+str(last)) diff = stretch(composite_band([ndvi(old, '5 4') ,ndvi(new, '5 4') ,ndvi(old, '5 4')]) ,stretch_type='stddev' ,num_stddev=3 ,min=0 ,max=255 ,dra=True ,astype='u8') m.add_layer(diff) diffbtn.on_click(on_diffbutton_clicked) diffbtn Error prompted Exception Traceback (most recent call last)<ipython-input-34-316a52ed9501> in on_diffbutton_clicked(b) 13 old = landsat.filter_by('OBJECTID='+str(first)) 14 new = landsat.filter_by('OBJECTID='+str(last))---> 15 diff = stretch(composite_band([ndvi(old, [5, 4]) 16 ,ndvi(new, [5, 4]) 17 ,ndvi(old, [5, 4])
... View more
04-02-2020
10:46 PM
|
1
|
0
|
1332
|
POST
|
I'm getting error 010531: sum of % influence weights must be equal to 100, and I really don't know why, I have tried multiple ways to make it worked but nothing, to my eyes it seems correct, but it's not working. this is the code, please take a look and let me know what do you see. try: myWOTable = WOTable([[ras4, 12, "LANDUSE", "('Brush/transitional' 5; 'Water' 'Restricted'; 'Barren land' 10; 'Built up' 3; 'Agriculture' 9; 'Forest' 4; 'Wetlands' 'Restricted'; 'NODATA' 'NODATA')"], [reclass_slope_1, 13, "VALUE", "(1 'Restricted'; 2 'Restricted'; 3 'Restricted'; 4 4; 5 5; 6 6; 7 7; 8 8; 9 9; 10 10; 'NODATA' 'NODATA')"], [reclass_eucD_rec_sites, 50, "VALUE", "(1 1; 2 2; 3 3; 4 4; 5 5; 6 6; 7 7; 8 8; 9 9; 10 10; 'NODATA' 'NODATA')"], [reclass_eucD_schools, 25, "VALUE", "(1 1; 2 2; 3 3; 4 4; 5 5; 6 6; 7 7; 8 8; 9 9; 10 10; 'NODATA' 'NODATA')"]], [eva_scl]) out_WeightedOverlay = WeightedOverlay(myWOTable) out_WeightedOverlay.save(weighted_suitable_areas) except: print(arcpy.GetMessages()) Error msn: Start Time: Sat Dec 22 23:46:33 2018 Failed to execute. Parameters are not valid. ERROR 010531: The sum of % Influence Weights must equal 100. Failed to execute (WeightedOverlay). Failed at Sat Dec 22 23:46:34 2018 (Elapsed Time: 0.27 seconds) Python Developer Communities GIS Developers Geo Developers
... View more
12-22-2018
11:54 PM
|
0
|
1
|
1431
|
POST
|
Randy Burton I made some changes that you recommended and It worked, thank you
... View more
12-22-2018
02:50 PM
|
0
|
0
|
1026
|
POST
|
Stephen M, thank you for your comment I believe the problem was that I had the wrong variable selected.
... View more
12-22-2018
02:50 PM
|
0
|
0
|
1026
|
POST
|
In my script I intent to select by location some features(polygons) from feature class call "opt_area", then I want to select other features from the same feature class using Select by attribute, then copy the selected features to a new feature class, but is not working. What it does is copying the entire feature class, not the features selected by SelectByLocation and SelectByAttribute try: arcpy.MakeFeatureLayer_management(opt_areas, opt_areas_layer) # Process: Selecting by Location; Use Selecting by Location to select features that are intersected by roads. arcpy.SelectLayerByLocation_management(opt_areas_layer, "INTERSECT", roads, "", "NEW_SELECTION", "") print("Select by location completed") # Process: Select by Attribute arcpy.SelectLayerByAttribute_management(opt_areas_layer, "ADD_TO_SELECTION", where_clause="Shape_Area >= 40469") print("Select by attribute completed") except: print(arcpy.GetMessages())
... View more
12-11-2018
06:41 AM
|
0
|
4
|
1192
|
Title | Kudos | Posted |
---|---|---|
1 | 04-02-2020 10:46 PM |
Online Status |
Offline
|
Date Last Visited |
05-29-2025
04:56 AM
|