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

Version number tweak and improved isLicensed() function and improvements to the confinement tool #28

Open
wants to merge 38 commits into
base: master
Choose a base branch
from

Conversation

Hornbydd
Copy link

@Hornbydd Hornbydd commented Jun 20, 2018

I set the version number to be a string to allow tool to run in ArcMap 10.6 and improved isLicensed() function in Bankfull channel tool. Original code relies on calling an advanced level tool, so code now checks if there is a valid desktop license and if it is ArcView/ArcEditor checks that spatial analyst extension is available. If these scenarios are not available then the tool is considered as unlicensed and will not run.
Also uploaded Item Description data with documented help for parameters, these are likely to improve as I understand the tool.

I have also made changes to the core confinement toolbox code, other module and Item descriptions

Hornbydd added 8 commits June 20, 2018 12:08
In ArcMap 10.6 this python toolbox came up with a syntax error, I simply enclosed the version number in single quotes. ArcMap then allowed it to run
Original code relies on calling an advanced level tool, so code now checks if there is a valid desktop license and if it is ArcView/ArcEditor checks that spatial analyst extension is available. If these scenarios are not available then the tool is considered as unlicensed and will not run.
Original code relies on calling an advanced level tool, so code now checks if there is a valid desktop license and if it is ArcView/ArcEditor checks that spatial analyst extension is available. If these scenarios are not available then the tool is considered as unlicensed and will not run.

Removed a few empty lines
The Tools have come with no Item Description information, especially there is no parameter help. Have inserted help, text mainly taken from the web page. Likely to update these again as I better understand the tool
Line 558 was causing tool to fail, after trying to follow logic I think this code was attempting retrieve a realization ID before it ever existed
So I Commented it out and replaced it with the below line: `idRealization = realization_id`
The key changes to this module are:

* The main function returns a Boolean that the calling module can use to determine if code executed without error
* I have added commenting to the code to explain what it is doing
* I have added basic error trapping using try/except
* I have added lots of messaging (arcpy.AddMessage()) to the code to report its progress to the user and is very helpful for debugging
These updated XML files are the files created when you edit the Items description. I have added minor tweaks to guide a user when using the tools.
I have made multiple edits to the core toolbox code, these are:

* Removed redundant imports to Riverscape module
* Set parameter type to GPFeatureLayer so the function testLayerSelection() would actually do it's job.
* Added basic error trapping to some of the code
* Inserted comments to explain what code is doing
* Commented out defunct code
* Added success check (via a Boolean) to ConfiningMargins.main()
* Updated version number to 2.2.04 - Hope this is appropriate?
@Hornbydd Hornbydd changed the title Version number tweak and improved isLicensed() function Version number tweak and improved isLicensed() function and improvements to the confinement tool Aug 24, 2018
@Hornbydd Hornbydd closed this Aug 24, 2018
@Hornbydd Hornbydd reopened this Aug 24, 2018
This folder contain the PNG files that are embedded into the Item Description of tools in the Confinement Toolbox
Tweaks, updates and images inserted into the Item Descriptions of various tools
This update includes the additional 4th parameter in LoadsInputs tool which is used to control if the channel polygon is buffered as it is copied into its respective sub-folder.
This function takes the processing in transfer_line() and attempts to fix the errors created by that function before transfer_line() returns the output to the calling function.
I have added a new parameter called filter by length and updated the Item Description for the tool. This Parameter allows the user to delete margins that fall below a specified length, default is 5m
With the addition of a new parameter to the tool interface this module needed updating to use it. main() code was primarily updated.
Thus function purges out unnecessary fields and creates a MarginID field in the confinement margin layer.
This is the Toolbox created by Duncan. It contains many tools for computing the various metrics required by the confinement project. They are design to use the output of the confinement tool (developed by Joe's team) but to also be as generic as possible. They are built around the intention of using them on UK data and whilst I have tried to be as generic as possible some "lock in assumptions" may have crept in. Don't know until tested!
Updated code to pass through which bank side the confining margin is by making use of the temporary datasets created during processing.
Updated code to enable bank side information to be attached to confining margin data. This allows the data to be used in models developed by Duncan in GeoData.
This is a upload to backup the toolbox. New tools have been added.
The valley cross section tool has been added to the toolbox. Tool interface has had metadata data added.
Contains a new tool for finding holes in floodplain (valley bottom) polygons and removing them when their mean elevation is less than 3m difference to the surrounding elevation pixels.
The function prepConfinementOutput attempts pass over bank side information using the XY as a link. But this can fail for some reason so code now captures this and reports failed Margin ID's
New tools added to tool box that partition up the valley bottom polygon and then clip back tributaries where required. Clipped polygons are inserted back into the input data and it is up to you to delete the old incorrect polygons if appropriate.
New (partially built) Stream Power Index tool added to tool box. Uploaded for backup purposes.
A couple of new tools added to the toolbox for identifying dodgy catchment areas and then a simple tool for recomputing stream power when a user has corrected the catchment area.
In an attempt to document work flow, tools, inputs, outputs and any quirky behaviour I have written this up as a help file using HelpNDoc, compiling it down to a CHM file.
Has much information but is missing workflow, plan to add this on next update.
Workflow page now contains an image map for clickable links.
New tools and workflow image updated.
Taken down because may not want to share this.
As well as adding new tools, I have ensured all tools are pointing to the help file which must be stored here: C:\GISApplications\Confinement Tools Help.chm

Tools are now numbered so it is more obvious in which order you should complete them. But some tools rely on external tools being run first and these are indicated in the workflow diagram in the associated help file.
Uploaded the help document,the latest HND file and associated image files
Gives instructions on how to unblock the CHM file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant