Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with ArcGIS 10.5 #1

Closed
giswqs opened this issue Feb 13, 2019 · 14 comments
Closed

Issue with ArcGIS 10.5 #1

giswqs opened this issue Feb 13, 2019 · 14 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@giswqs
Copy link
Member

giswqs commented Feb 13, 2019

One user reported having a "No response" issue opening the toolbox in ArcGIS 10.5. I just tested it myself and found that it indeed takes a while (~ 10 mins) to first open it in ArcGIS 10.5. Note that the toolbox (WhiteboxTool.pyt) contains over 25,000 lines of Python code. Therefore, it could take some time to load for the first time. Please be patient.

I don't have a solution for it as this moment. I would recommend upgrading to ArcGIS 10.6 (Python 2.7) or ArcGIS Pro (Python 3.6). The toolbox has been tested to work well on ArcGIS 10.6 and ArcGIS Pro.

ArcGIS 10.5
ArcGIS-10.5

ArcGIS 10.6
ArcGIS-10.6

ArcGIS Pro
ArcGIS-10.6

@giswqs giswqs added help wanted Extra attention is needed bug Something isn't working labels Feb 13, 2019
@Yingjie4Science
Copy link

Yes. A similar issue happened to my PC. I am currently using 10.5, and the toolbox cannot work and is labeled by a RED CROSS.

@giswqs
Copy link
Member Author

giswqs commented Feb 19, 2019

@yingjieli-science When I tested on ArcGIS 10.5, the Toobox took ~10 mins to load for the first time, but it did work. ArcGIS 10.6 has no issue. My suggestion would be to upgrade to 10.6 if you can. Otherwise, you might want to try WhiteboxTools outside ArcGIS. Check out the links below:

@Yingjie4Science
Copy link

@yingjieli-science When I tested on ArcGIS 10.5, the Toobox took ~10 mins to load for the first time, but it did work. ArcGIS 10.6 has no issue. My suggestion would be to upgrade to 10.6 if you can. Otherwise, you might want to try WhiteboxTools outside ArcGIS. Check out the links below:

Sounds great! Thank you!

@geoendemics
Copy link

geoendemics commented Apr 3, 2019

Hi guys
First of all thanks for your effort in adapting this fantastic tool to ArcGIS. I want to report a bug, that appears when trying to run WBT in ArcGIS 10.6. Most of the modules ends up with successed, but produce no results. When looking at the processing results in ArcGIS I often get the following error:

bugs: thread 'main' panicked at 'Unrecognized raster type', src\main.rs:66:21
note: Run with RUST_BACKTRACE=1 for a backtrace.

Messages
Executing: HypsometricAnalysis N:\AvdH\FoU\SURF\ila\SURF\dem\dem.tif # \nve.no\fil\home\rzo\Skrivebord\apt\hypso.html
Start Time: Fri Mar 08 13:37:23 2019
Running script HypsometricAnalysis...
.\whitebox_tools.exe --run="HypsometricAnalysis" --inputs='N:\AvdH\FoU\SURF\ila\SURF\dem\dem.tif' --watershed='\nve.no\fil\home\rzo\Skrivebord\apt\hypso.html' --output='None' -v


  • Welcome to HypsometricAnalysis *

thread 'main' panicked at 'Unrecognized raster type', src\main.rs:66:21
note: Run with RUST_BACKTRACE=1 for a backtrace.

Completed script HypsometricAnalysis...
Succeeded at Fri Mar 08 13:37:32 2019 (Elapsed Time: 8,83 seconds)

I also get this one when I tried to run hillshade

Messages
Executing: Hillshade N:\Prosjekter\Elvevifter\6_data_c\FinalDTM\tif1.tif N:\Prosjekter\Elvevifter\6_data_c\FinalDTM\shade.tif 315 30 1
Start Time: Wed Apr 3 23:48:32 2019
Running script Hillshade...
.\whitebox_tools.exe --run="Hillshade" --dem='N:\Prosjekter\Elvevifter\6_data_c\FinalDTM\tif1.tif' --output='N:\Prosjekter\Elvevifter\6_data_c\FinalDTM\shade.tif' --azimuth=315 --altitude=30 --zfactor=1 -v


  • Welcome to Hillshade *

Reading data...
thread 'main' panicked at 'index out of bounds: the len is 32768 but the index is 9223372036854775808', src\tools\terrain_analysis\hillshade.rs:346:21
note: Run with RUST_BACKTRACE=1 for a backtrace.
thread 'thread 'thread 'thread 'thread '' panicked at '' panicked at 'called Result::unwrap() on an Err value: "SendError(..)"' panicked at 'thread '' panicked at 'called Result::unwrap() on an Err value: "SendError(..)"', ', called Result::unwrap() on an Err value: "SendError(..)"src\libcore\result.rs' panicked at '' panicked at ':src\libcore\result.rscalled Result::unwrap() on an Err value: "SendError(..)"1009', ', :src\libcore\result.rs5called Result::unwrap() on an Err value: "SendError(..)"
:src\libcore\result.rscalled Result::unwrap() on an Err value: "SendError(..)"1009:', ::1009', :1009src\libcore\result.rs::5thread 'thread '
5thread '
' panicked at '1009thread ':src\libcore\result.rs55' panicked at ':
called Result::unwrap() on an Err value: "SendError(..)"' panicked at 'called Result::unwrap() on an Err value: "SendError(..)"called Result::unwrap() on an Err value: "SendError(..)"
', ', ' panicked at 'src\libcore\result.rscalled Result::unwrap() on an Err value: "SendError(..)"1009', :src\libcore\result.rs::51009',
:1009thread 'src\libcore\result.rssrc\libcore\result.rs:5:thread '51009:' panicked at '5
:
called Result::unwrap() on an Err value: "SendError(..)"
' panicked at '1009called Result::unwrap() on an Err value: "SendError(..)":', 5src\libcore\result.rs', :
src\libcore\result.rs1009::10095:
5

Completed script Hillshade...
Succeeded at Wed Apr 3 23:48:36 2019 (Elapsed Time: 4,29 seconds)

I would appreciate any help
Best regards
Rengifo

@giswqs
Copy link
Member Author

giswqs commented Apr 4, 2019

@geoendemics Thank you for reporting the issues. I am currently out of town for a conference. I will look into these issues when I return next week.

@giswqs
Copy link
Member Author

giswqs commented Apr 9, 2019

@geoendemics The issue was caused by the inconsistent order of parameters of some tools between the WhiteboxTools Python interface and command-line program. For example, for the HypsometricAnalysis tool, the parameter order for the command-line program is (input, watershed, output), whereras the parameter order for the Python interface is (input, output, watershed). This inconsistent order caused problems when passing parameter values from ArcGIS Toolbox to the command-line program.The bug has been fixed now. Please download the latest version and try again.

Regarding the issue with the Hillshade tool, it is probably data-specific. I tried it on the test data without any problem.

Command-line program:

>>.\whitebox_tools.exe -r=HypsometricAnalysis -v --wd="\path\to\data\" -i="DEM1.tif;DEM2.tif" --watershed="ws1.tif;ws2.tif" -o=outfile.html

Python:

def hypsometric_analysis(self, inputs, output, watershed=None, callback=None):

@jblindsay
Copy link
Collaborator

@giswqs Yes, it's true that there is some inconsistency there. The reason is default parameter values. Python allows for default parameter values, however, all parameters with defaults must occur after non-default parameters in the function call. This necessitated the reordering of the parameters in the Python WhiteboxTools interface script. In fact, the parameters are read in by the command-line program as flags and their order is not significant.

@giswqs
Copy link
Member Author

giswqs commented Apr 10, 2019

@jblindsay Thanks for the clarification. I have now added explicit parameter names to all WBT function calls within ArcGIS Toolbox (e.g., wbt.hypsometric_analysis(inputs, watershed=watershed, output=output)). The order of parameters is no longer an issue.

class HypsometricAnalysis(object):

    def execute(self, parameters, messages):
        inputs = parameters[0].valueAsText
        watershed = parameters[1].valueAsText
        output = parameters[2].valueAsText
        old_stdout = sys.stdout
        result = StringIO()
        sys.stdout = result
        wbt.hypsometric_analysis(inputs, watershed=watershed, output=output)
        sys.stdout = old_stdout
        result_string = result.getvalue()
        messages.addMessage(result_string)
        return

@geoendemics
Copy link

dear Quisheng
Thanks for your quick response. I did downloaded the new version and things start to work now but, I am still experiencing some issues:

Messages
Executing: DrainagePreservingSmoothing N:\Prosjekter\Elvevifter\6_data_c\FinalDTM\utvik_arc.asc N:\Prosjekter\Elvevifter\6_data_c\FinalDTM\drainsmooth.tif 11 15 3 # 80 0,15 1
Start Time: Fri Apr 12 11:30:41 2019
Running script DrainagePreservingSmoothing...
.\whitebox_tools.exe --run="DrainagePreservingSmoothing" --dem='X:\Prosjekter\Elvevifter\6_data_c\FinalDTM\utvik_arc.asc' --output='X:\Prosjekter\Elvevifter\6_data_c\FinalDTM\drainsmooth.tif' --filter=11 --norm_diff=15 --num_iter=3 --max_diff=None --reduction=80 --dfm=0,15 --zfactor=1 -v

thread 'main' panicked at 'called Result::unwrap() on an Err value: ParseFloatError { kind: Invalid }', src\libcore\result.rs:1009:5
note: Run with RUST_BACKTRACE=1 for a backtrace.

Completed script DrainagePreservingSmoothing...
Succeeded at Fri Apr 12 11:30:46 2019 (Elapsed Time: 4,22 seconds)

The same error in this module as before. This module ends up with success but not results
Have a nice weekend

@jblindsay
Copy link
Collaborator

@giswqs That 'None' for the --max_diff parameter is the source of the problem. WhiteboxTools will try to parse that into a float. For optional parameters, the front-end should simply not specify the parameter at all (i.e. leave out the --max_diff parameter). For default parameters, the front end should specify the default value for any unspecified parameters. Hope that helps.

@jblindsay
Copy link
Collaborator

@giswqs Actually, looking into the specifics of that tool I now realize that there is a default value for the --max_diff parameter (--max_diff=0.5). In fact, I don't think that there are any tools in the library that have optional parameters that don't have a default value. Something must have happened to have missed out on the default value of this one, or geoendemics deleted the value from the user interface and the front-end did not do quality control to identify the unspecified parameter, issuing an error prior to calling WhiteboxTools.

@giswqs
Copy link
Member Author

giswqs commented Apr 12, 2019

@jblindsay The bug has been fixed. All tool parameters for the ArcGIS Tool interface was based on the returned string from the function wbt.tool_parameters(tool_name). When extracting the tool parameters from the returned string, I used some keywords (e.g., "name", "flags", "description", "optional") to search and pass values. I did not realize that some tool descriptions contain the word "(optional)" in addition to the optional parameter at the end of the string. The problem was resolved by simply removing the word "(optional)" from the string before extracting values for each parameter. In this way, the string only contains one optional keyword.

{"name":"Maximum Elevation Change","flags":["--max_diff"],"description":"Maximum allowable absolute elevation change (optional).","parameter_type":"Float","default_value":"0.5","optional":true},

@geoendemics Please download the latest version and try again. It should be working now.

Imgur

@geoendemics
Copy link

geoendemics commented Apr 23, 2019

Hei Guys I am having the same issue of memory allocation in ArcGIS 10.6 as I jad in R. I have already sumitted the bugs to whiteboxR
best regards

Executing: Slope W:\StatensKartverk\DTM10\20190306_DTM10\DTM10_UTM33_20190301_mosaic_v2.tif W:\StatensKartverk\DTM10\20190306_DTM10\DTM10_UTM33_20190301_mosaic_v2_slope.tif 1
Start Time: Tue Apr 23 10:00:31 2019
Running script Slope...
.\whitebox_tools.exe --run="Slope" --dem='W:\StatensKartverk\DTM10\20190306_DTM10\DTM10_UTM33_20190301_mosaic_v2.tif' --output='W:\StatensKartverk\DTM10\20190306_DTM10\DTM10_UTM33_20190301_mosaic_v2_slope.tif' --zfactor=1 -v


  • Welcome to Slope *

Reading data...
memory allocation of 77553370898 bytes failed

Completed script Slope...
Succeeded at Tue Apr 23 10:00:36 2019 (Elapsed Time: 5,95 seconds)

@hafez-ahmad
Copy link

it worked for ArcGIS 10.5
image

@giswqs giswqs closed this as completed Dec 9, 2021
@giswqs giswqs pinned this issue Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants