Giter Club home page Giter Club logo

whiteboxtools-arcgis's Introduction

WhiteboxTools-ArcGIS

docs ArcGIS python R QGIS License: MIT Donate

ArcGIS Python Toolbox for WhiteboxTools.

This repository is related to the ArcGIS Python Toolbox for WhiteboxTools, which is an ArcGIS frontend of a stand-alone executable command-line program called WhiteboxTools.

Note Important Note: This toolbox only supports ArcGIS Pro and ArcGIS 10.6 or newer. Don't waste your time trying it on ArcGIS 10.5 or older versions.

Contents

Description

WhiteboxTools-ArcGIS is an ArcGIS Python Toolbox for WhiteboxTools, an advanced geospatial data analysis platform developed by Prof. John Lindsay (webpage; jblindsay) at the University of Guelph's Geomorphometry and Hydrogeomatics Research Group. WhiteboxTools can be used to perform common geographical information systems (GIS) analysis operations, such as cost-distance analysis, distance buffering, and raster reclassification. Remote sensing and image processing tasks include image enhancement (e.g. panchromatic sharpening, contrast adjustments), image mosaicing, numerous filtering operations, simple classification (k-means), and common image transformations. WhiteboxTools also contains advanced tooling for spatial hydrological analysis (e.g. flow-accumulation, watershed delineation, stream network analysis, sink removal), terrain analysis (e.g. common terrain indices such as slope, curvatures, wetness index, hillshading; hypsometric analysis; multi-scale topographic position analysis), and LiDAR data processing. LiDAR point clouds can be interrogated (LidarInfo, LidarHistogram), segmented, tiled and joined, analyized for outliers, interpolated to rasters (DEMs, intensity images), and ground-points can be classified or filtered. WhiteboxTools is not a cartographic or spatial data visualization package; instead it is meant to serve as an analytical backend for other data visualization software, mainly GIS. Suggested citation: Lindsay, J. B. (2016). Whitebox GAT: A case study in geomorphometric analysis. Computers & Geosciences, 95, 75-84. doi:10.1016/j.cageo.2016.07.003.

Installation

Step 1: Download the toolbox

  1. Click the green button (Clone or download) on the upper-right corner of this page to download the toolbox as a zip file.

  2. Depcompress the downloaded zip file.

Step 2: Connect to the toolbox

  1. Navigate to the Folder Connections node in the catalog window tree.

  2. Right-click the node and choose Connect To Folder.

  3. Type the path or navigate to the WhiteboxTools-ArcGIS folder and click OK.

  4. Browse into the toolbox and start using its tools.

Usage

Open any tool within the toolbox and start using it. Check out the WhiteboxTools User Mannual for more detailed help documentation of each tool.

Tutorials

Introducing WhiteboxTools frontends (Python, Jupyter, ArcGIS, R)

Available Tools

The WhiteboxTools library currently contains 468 tools, which are each grouped based on their main function into one of the following categories: Data Tools, GIS Analysis, Hydrological Analysis, Image Analysis, LiDAR Analysis, Mathematical and Statistical Analysis, Stream Network Analysis, and Terrain Analysis. For a listing of available tools, complete with documentation and usage details, please see the WhiteboxTools User Manual.

Supported Data Formats

The WhiteboxTools library can currently support read/writing raster data in Whitebox GAT, GeoTIFF, ESRI (ArcGIS) ASCII and binary (.flt & .hdr), GRASS GIS, Idrisi, SAGA GIS (binary and ASCII), and Surfer 7 data formats. The library is primarily tested using Whitebox raster data sets and if you encounter issues when reading/writing data in other formats, you should report the issue. Please note that there are no plans to incorporate third-party libraries, like GDAL, in the project given the design goal of keeping a pure (or as close as possible) Rust codebase.

At present, there is limited ability in WhiteboxTools to read vector geospatial data. Support for Shapefile (and other common vector formats) will be enhanced within the library soon.

LiDAR data can be read/written in the common LAS data format. WhiteboxTools can read and write LAS files that have been compressed (zipped with a .zip extension) using the common DEFLATE algorithm. Note that only LAS file should be contained within a zipped archive file. The compressed LiDAR format LAZ and ESRI LiDAR format are not currently supported by the library.

Contributing

If you would like to contribute to the project as a developer, follow these instructions to get started:

  1. Fork the WhiteboxTools-ArcGIS repository (https://github.com/opengeos/WhiteboxTools-ArcGIS)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Unless explicitly stated otherwise, any contribution intentionally submitted for inclusion in the work shall be licensed as the MIT license without any additional terms or conditions.

License

The ArcGIS Toolbox for WhiteboxTools is distributed under the MIT license, a permissive open-source (free software) license.

Reporting Bugs

ArcGIS Toolbox for WhiteboxTools is distributed as is and without warranty of suitability for application. If you encounter flaws with the software (i.e. bugs) please report the issue. Providing a detailed description of the conditions under which the bug occurred will help to identify the bug. Use the Issues tracker on GitHub to report issues with the software and to request feature enchancements. Please do not email Dr. Qiusheng Wu or Dr. John Lindsay directly with bugs.

Toolbox Screenshots

Toolbox-1 Toolbox-2 Toolbox-3

whiteboxtools-arcgis's People

Contributors

giswqs avatar hornbydd avatar jblindsay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

whiteboxtools-arcgis's Issues

Raise wall with ArcGIS 10.8

Hello,

I am using Raise wall to insert a dam in a DEM, but I am constantly getting the below error:

image

Kindly assist.

Thanks,

SmoothVegetationResidual Fails to open in ArcPro Toolbox

With the most recent WhiteboxTools-ArcGIS-master zip (downloaded today), as well as the first version I downloaded ~4 months ago, the "SmoothVegetationResidual" tool fails to open with the following error:
image
This error occurs prior to loading/selecting any files. My version of WBT is licensed with the GTE and I can verify that other licensed tools succeed in opening and running.

SmoothVegetationResidual also runs successfully when running from wb_runner.py
(Note: John Lindsay helped troubleshoot over chat and asked me to post the issue here, as it seems to be related to the Arc toolbox specifically)

No classification data

Used machine learning tools to create classification data using the Kmeans cluster. The processing shows to be successful, however, we have no outputs in the specified folder. I am running the toolbox on ArcGIS desktop 10.8.1.
Thank you

Burn Streams At Roads runs but produces no output, thread 'main' panicked at 'called `Option::unwrap()` on a `None` value'

I am trying to burn streams through roads for this raster. This is a 3DEP 1m DEM, which I applied a 3x3 round focal statistics mean smoothing to beforehand. I am trying to delineate sinkholes and want to burn in the streams to eliminate many of the false sinks caused by road cuts. The tool seems to run with no issues but nothing is produced and it runs way too fast. I looked at the log and it says the following:

Reading streams and roads data...
Reading DEM raster...
thread 'main' panicked at 'called Option::unwrap() on a None value', whitebox-raster\src\lib.rs:1361:69
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
Succeeded at Thursday, March 28, 2024 2:11:45 PM (Elapsed Time: 0.14 seconds)

Any idea what the problem is? I can't find anything in the issues or manual?

burnstreamsatroads
catalog_view

Red Exclamation point on ArcGIS WBT toolbox

I upgraded to the 2.1 release and now when I go to use or connect to the toolbox it always shows a red exclamation point by the toolbox. I've tried deleting everything and re-extracting it all again to the same folder but the exclamation point still shows up.
image

Lidar Tile Footprint error

I tested "Lidar Tile Footprint" in WhiteboxTools-ArcGIS(v1.1.0) using ArcGIS Pro 2.4, but I got an error.

Traceback (most recent call last):
File "", line 21613, in execute
TypeError: lidar_tile_footprint() got multiple values for argument 'output'

Issue with ArcGIS 10.5

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

LiDAR Join tool fails when executed from ArcGIS Pro (v2.7.1)

Tried to input two LAS files to join them and assigned the output with the .LAS extension. However, the tool fails immediately after execution with the following error:

Traceback (most recent call last):
File "", line 20731, in execute
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy_init_.py", line 1255, in Describe
return gp.describe(value, data_type)
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing_base.py", line 383, in describe
self._gp.Describe(*gp_fixargs(args, True)))
OSError: "'C:MY PATH TO LIDAR FILE\USGS_LPC_PR_PRVI_D_2018_19QGA40004500.las'" does not exist
Failed to execute (LidarJoin).

The LiDAR files DO exist on the specified paths.
image

PS. Thanks to everyone working on this project!

Enhancement to Extract Nodes tool

Whilst promoting your excellent tool on GIS Stack Exchange I thought this tool could do with a set of useful enhancements. Not being a rust developer its outside my skillset so I thought I would just say what I'm thinking.

  1. It would useful if this tool created and populated the output with an X and Y field for the points it extracted.
  2. The PARENT_ID field is offset by 1 to the FID it was generated from, I think this needs to be corrected as it makes joining data problematic.
  3. It would be good to have a sequence field count the vertex position in the polygon ring, which resets with every PARENT_ID.
  4. Finally this is a personal preference but to me a node is a terminal vertex in a polyline. The points that make up a line or polygon are vertices, you even refer to them as vertices in your help file, so may be the tool should be renamed to extract vertices?

Just some ideas to keep you on your toes! :)

new wtb release falis when trying to run geomorphons on ArcGIS pro 3.0.0

Hi guys !
Congratulations on this great release.
Below the error, I get when trying to run geomorphons in ArcGIS pro 3.0.0

Traceback (most recent call last):
File "", line 13623, in execute
TypeError: geomorphons() got an unexpected keyword argument 'tdist'

Failed to execute (Geomorphons).

PS: it works perfectly when I run it using wtb runner.

Best
regards
Rengifo Ortega

Idea to improve robustness of all tools that take vector input

So I was about to suggest there were errors in the following tools:

  • VECTOR LINE TO RASTER
  • VECTOR POINT TO RASTER

But lucky for me I tested my input data. Turned out the problem was that my input data was a file geodatabase featureclass. Once I exported the layer to shapefile format the tools ran without error.

Now I went and had a look at the WBT manual and it does indeed say that it only accepts shapefiles but I think the tool needs to trap this as the error message returned gives no indication as to what the problem was to the user. This can be easily rectified by inserting the following code into the updateMessges() section of each tool that takes a vector layer as input. Here is the code

    def updateMessages(self, parameters):
        # Assumes that parameter 0 is always the vector input
        if parameters[0].altered:
            layer = parameters[0].value
            desc = arcpy.Describe(layer)
            if desc.FeatureClass.dataType != "ShapeFile":
                parameters[0].setErrorMessage("This tool expects the layer to be a Shapefile")
            else:
                parameters[0].clearMessage()
        return

Currently the tools are doing little or no input validation and this simple addition will make the user experience certainly less frustrating.

ArcMap 10.8

I followed the instructions and it doesn't work in ArcMap 10.8. I'm getting a red X over the toolkit icon.
In QGIS and ArcGIS Pro it works!

Outputs don't have defined coordinate systems

Just been testing the vector point to raster tool, I assume this is an issue in all tools that generate a raster as an output. My gut feeling this is an issue with WBT ( @jblindsay ) rather than the python toolbox, but could be wrong?

My input dataset is a point dataset with a British_National_Grid coordinate system, the resulting TIF raster has no coordinate system as shown below:

image

I can run the define projection tool to set it to British_National_Grid.

I notice that if I feed this raster (with a coordinate system set) straight into a raster to vector polygon tool the output shapefile retains the coordinate system.

The output should not be loosing the coordinate system.

I see two options:

  1. If it is a bug in WBT then fix it.
  2. If it is a limitation in WBT and rasters drop coordinate systems for what ever reason, then why not call the define projection tool within the execute() part of the function as a last step to ensure output has a valid coordinate system. Users should not be required to run the define projection tool when the input had a coordinate system.

Tool Openness not recognized

Thank you for all your work on this. I've been trying to run the openness tool, but I keep running into the same error where it says whitebox_tools.exe doesn't contain a tool called "Openness" (exact message 'Unrecognized tool name Openness.'). Other tools that I've tried do seem to work.

Bug in vector to raster tool

When I run the vector Polygon to Raster tool as shown below it crashes with the error:

image

PolygonsToRaster National_Nature_Reserves_England nnr_name C:\Scratch\test.tif true 10 #
Start Time: Tue Feb 25 23:37:33 2020
Running script VectorPolygonsToRaster...

Traceback (most recent call last):
File "", line 2671, in execute
File "c:\program files (x86)\arcgis\desktop10.6\arcpy\arcpy_init_.py", line 1260, in Describe
return gp.describe(value, data_type)
File "c:\program files (x86)\arcgis\desktop10.6\arcpy\arcpy\geoprocessing_base.py", line 376, in describe
self._gp.Describe(*gp_fixargs(args, True)))
AttributeError: Object: Error in parsing arguments for Describe

Failed to execute (VectorPolygonsToRaster).
Failed at Tue Feb 25 23:37:33 2020 (Elapsed Time: 0.03 seconds)

On looking at the code at line 2671 the line:

desc = arcpy.Describe(base)

Implies that the parameter base is not actually an optional parameter, code needs modifying to resolve this, I am unsure how you are passing in "nothing" into the WBT when base is nothing?

wbt.vector_polygons_to_raster(i=i, field=field, output=output, nodata=nodata, cell_size=cell_size, base=base)

Diff. from mean elevation

I'm running WhiteboxTools-ArcGIS within ArcGIS 10.7 with no issues. However, when trying to run the Diff. from mean elevation using the testdata DEM.tif get the following:

Traceback (most recent call last):
File "", line 9663, in execute
TypeError: diff_from_mean_elev() got an unexpected keyword argument 'i'

Failed to execute (DiffFromMeanElev).
Failed at Mon Jul 27 13:39:50 2020 (Elapsed Time: 0.22 seconds

Raster processing tools that take a raster OR a constant fail

There are many tools in the Math and Stats Tool toolset that have parameters that take a raster OR a constant. If try to run any of these tools they all fail as you cannot proceed as they reject a constant value.

Take the Divide tool as example you cannot divide your test data DEM.tif by a number.

For these tools expanding the allowable list of data types resolves the issue, I tried the following:

datatype=["GPRasterLayer","Long","Double"]

Enhancement to View Code tool

This is a useful tool that generates a URL for the source code but I would like to suggest it takes it one step further and actually take you to the web page. Why else would you use this tool if not for reviewing the code?

To make my suggestion work you would need to include the following import at the top of the file:

import webbrowser

Then replace the following code in the execute() function for the ViewCode class with the following:

    def execute(self, parameters, messages):
        """The source code of the tool."""
        param0 = parameters[0].valueAsText
        tool_name = param0.replace(" ", "").strip()        
        messages.addMessage("Opening default browser...")
        webbrowser.get('windows-default').open(wbt.view_code(tool_name))
        messages.addMessage(wbt.view_code(tool_name))
        return

A small tweak that would make this tool more helpful.

Issue with ArcGIS 10.7 and Pro 2.9 LiDAR Tools

Hi, I have a WTB toolbox download from over a year ago (has fewer tools than the new download, like 'LidarContour') that works okay on my personal computer. However, I just downloaded a fresh toolbox to my Amazon EC2 ArcGIS Server instance, and tried to utilize the 'LidarContour' and 'LasToShapefile' in both ArcMap and Pro, and both instantaneously fail and show the same errors in the GP results 'messages' window. Tool inputs and error messages are show below. Something with an unexpected keyword argument.

LiDAR Data: .LAS file downloaded from USGS 3DEP.

Error Messages/ Tool Inputs
Las2Shp_Failure
LidarContour_Failure

Toolbox now only supports ArcGIS Pro.

WhiteboxTools now uses python 3.
An example of this is the use of Python 3's f-Strings format at line 218 in whitebox_tools.py
Readme.MD should be updated to reflect this toolbox now only supports ArcGIS Pro.

Bug in Merge Vectors tool

There is a bug in the Merge Vectors tool in the Data Tools toolset.

Example input (both polygon layers):

image

Result:

Executing: MergeVectors single2;single C:\Scratch\merge.shp
Start Time: Wed Mar 4 10:27:46 2020
Running script MergeVectors...

Traceback (most recent call last):
File "", line 1925, in execute
TypeError: merge_vectors() got an unexpected keyword argument 'i'

Failed to execute (MergeVectors).
Failed at Wed Mar 4 10:27:46 2020 (Elapsed Time: 0.23 seconds)

ArcGIS Version this toolbox was designed for should be clearly stated.

Hello.. I was initially excited to see an ArcGIS option available and read the readme file. I am running ArcGIS 10.4 but there was no indication of version this was developed for, so I gave it a try. It behaved painstakingly slow when initially loaded, similar to the 10.5 issue, but also creates an XML file for EVERY WBT command in the WBT folder where the toolbox is stored. One reason for the slow load time.. but it takes forever starting ArcMap when this tool is loaded, and the functions run but do nothing. I understand it is likely not compatible.. but my recommendation to you is to save people the heartache and just state Up Front - like perhaps in the readme file - what version ArcGIS this should be run in (e.g. 10.6 or above!). Because you can't assume everyone out there is running the latest and greatest. Thank you. JG

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.