Code Monkey home page Code Monkey logo

arcgnat's People

Contributors

aagervasi avatar jeansfr avatar jesselangdon avatar joewheaton avatar kellymwhitehead avatar mattreimer avatar philipbaileynar avatar volkcj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

arcgnat's Issues

Non-urgent: Bad auto-fill of outputs in Stream Sinuosity and Planform Tool

Suggest either removing or changing the auto-fill of outputs in Stream Sinuosity and Planform Tool. At the moment it is currently filling out the 3 outputs (stream sinuosity, valley CL sinuosity, and planform polylines) as the same file name:
auto-fill_orig

To create them as 3 separate polyline outputs with a desired naming scheme and file location, I edited to:
auto-fill_edit

Transfer Line Attributes creates -99999 values for segments with same geometry; related to failure?

Tested the Transfer Line Attributes tool for the Lolo watershed network from Jean's EP layer (“Lolo_NHD_FullExtent_20160906.shp”) to the NHDFlowline from the NHD website.

  1. Generate New Lolo Network by running Transfer Line Attributes for Lolo network only.
    a. Clip NHD_Flowline to CHaMP watershed (Lolo) boundary; make sure to extent the most downstream segment out beyond the watershed as it is in Jean’s layer and in original NHDFlowline.
    i. Output: “NHDFlowline_20170502_Lolo”
    b. Run the TLA Tool.
    i. FROM: “Lolo_NHD_FullExtent_20160906.shp”
    ii. TO: “NHDFlowline_20170502_Lolo.shp”
    iii. OUTPUT: “Lolo_EPtoNHD_20170621”

  2. Output sent as a feature class to a geodatabase.
    c. TLA Failure, with products created.

  3. Examine the segments that did not join (received -9999 values)
    a. Seems that in all these areas Jean’s layer has segments split into multiple segments whereas the NHDFlowline has only one segment. Perhaps issue is that attribute values should be identical between these split segments, but in some cases CHINRATE and STHDRATE have different values between segments?
    i. This does not appear to be causing issues (when values are different in Jeans layer between segments that should be the same in NHD layer) based on other areas in the data where NHDFlowline had one segment and Jean's layer has multiple segments with slightly different attribute values (for non-essential fields)
    b. Only issue I can see is geometry is the same but segment lengths differ.
    i. Uncertain if failure message is related to this or not.

Data:
https://www.dropbox.com/s/qb9tl6oqrysr9r4/TLA_Issue_Lolo.zip?dl=0
Failure message:
screenshot 2017-06-21 13 30 44

networkVrtx not generated in Build Network Topology Tool

Ran a 1000m segmented network through the Build Network Topology Tool using GNAT version 2.1.06. It appears the networkVrtx table was still not generated (based on the dissolving in-memory data at the end); the Topology network "run 01" successfully generated as well as the Stream Network Table.

screenshot 2017-05-30 14 31 49

GNAT.pyt needs to be cleaned up

Currently the GNAT.pyt file has a lot of commented out modules import statements, and unused modules. Needs to be cleaned up.

All tools should output to shapefiles or file geodatabase feature classes

All tools should be able to output to shapefiles or File GDB at the user's preference. This is a bit of a task. I have already encountered one issue (Sinuosity tool) where the difference between shp and fgdb caused an error (unrelated to know issues like field names, etc). We will need to push to make sure shapefiles are the primary input/output type as we convert to project based GNAT.

Bad results from Transfer Network Attribute tool

In cases where the "target" stream network has reaches/segments that do not exist in the "source" dataset, attribute values from connected, adjacent stream reaches are transferred over to the "target" network reaches. There are also incorrect values being transferred.

Error creating GNAT Project

GNAT version 2.1.06. I am unable to create a new GNAT Project using the "Create a New GNAT Project Tool". This is keeping me from being able to run segmentation of the stream network.
screenshot 2017-06-05 15 53 51
screenshot 2017-06-05 15 53 57
screenshot 2017-06-05 15 59 17

Find Network Features tool not detecting small gaps in network

Small gaps (~20cm) in the network that are disconnected pass through the Network Errors tool without being detected.

Please see attached zip with:

  1. Geodatabase: has the segmented (1000m) network for Lolo watershed. It was run twice through the Build Network Topology and Find Network Features tools (corresponds to run01 and run02 feature classes, respectively) and the Stream Network and Network Features tables and Network Vertex layer link to run02.
  2. mxd: Has bookmarks corresponding to the locations of all the small gaps that were detected using the FLoWs tool in checking for compatibility of the network with HexSim.

Lolo.zip

Add geomorphic attributes to project XML

There is a need to symbolize geomorphic attributes (i.e. sinousity, planform, threadedness, gradient) in the Riverscapes toolbar. To do that, whether or not these attributes were calculated for a segmented stream network should be stored in the project XML file.

This information can be stored as parameter nodes within the GNAT realization.

Non-urgent: Commit Stream Network Script does not display fields in drop-down

After Creating a new GNAT Project and Loading the Input Data Sets, when I select the Stream Network shapefile from the GNAT Riverscapes project folder, the drop-down is blank. It will work correctly and run through Segmentation; I just have to manually type in "ReachID" as the Unique ID field.

screenshot 2017-08-09 11 13 24
screenshot 2017-08-09 11 13 39

Data:
https://www.dropbox.com/home/Riverscapes_share/Lochsa_Data

(Original Stream Network used for the commitment is the run02 network from the Preprocess.gdb--all Riverscapes data is inside the GNAT Riverscapes folder)

Network Vrtx file output written as shapefile into Toolbox folder, rather than geodatabase

So in this version of arcGNAT (2.2), it looks like Build Network Topology has gone back to writing the NetworkVrtx nodes out into a shapefile that goes into the Toolbox folder, rather than into the Preprocess geodatabase with the _run01 and Stream Network table output. Any way we can switch it back to writing it into the geodatabase? (It had been fixed several versions ago and was doing this correctly up to the last version I've been using, arcGNAT_2.1.12)

Thanks.

GNAT Riverscapes xml writing bad output path for segmented networks

Xml files store segmented network path as Outputs\ [RealizationName] \Analyses\ [AnalysisName] \SegmentedNetwork.shp\SegmentedNetwork.shp

Though they are actually stored as: Outputs\ [RealizationName] \Analyses
[AnalysisName] \SegmentedNetwork.shp

Discovered this issue in version 2.3.1--unsure yet how many versions back this issue goes.

inkedgnatriverscapes_xml_issue_li

Using a "*_processed" feature class as an input in the Find Network Errors tool causes an error

(From Jean) The tool crashed when I made edits to the *_processed file and tried to re-run the Find Network Errors tool.

You must make edits to the original dataset, then rerun the Topology tool before you run the error tool again. It would be more convenient to be able to make edits to the *_processed file and be able to re run the error tool as you are working without having to go back to the topology tool. This would allow you to maintain a original dataset in case you make a mistake.

Sinuosity Tool Shapefiles Error

There is an arcgis bug that is preventing shapefiles to work with the sinuosity tool.

Need to modify how the features are tracked without using OID/FID to remedy this.

Sinuosity / Planform Attributes

Update sinousity and planform tool.

  1. Does this need its own tool/project?
  2. Part of Confinement tool?
  3. Integrated Width also?

Issue with Segmentation tool

Both arcGNAT_2.1.01_050317 and arcGNAT_2.1.03_beta are having an issue where the repaired stream network will not load into the tool (as either a feature class or a shapefile) in the Stream Network Polyline Feature Class input.

Also I am not able to get anything to fill out under Output Segmented Line Network when I try to save the output (possibly due to the loading issue); it only allows me to try to save the output as a Geodatabase or a Basic Type, when I am trying to output a feature class into a new geodatabase.

screenshot 2017-05-05 16 11 07

Small bug when using "in_memory" for workspace

There is currently a small bug in the Calculate Threadedness tool thich occurs when using "in_memory" for the temporary workspace. I think there is an issue with how the NODE_TYPE fields are being named when merging (see line 131).

The main() function for the StreamTool accepts the wrong number of outputs

The tool accepts three output names, but it only has two in the main function, which leads to the third output name overwriting the name of the scratch workplace. This breaks the program fairly quickly. While looking through GNAT.pyt, I saw that the text for properly passing on all variables was commented out. I'm not certain why they were commented out, but, after modifying it to only take two output files, I managed to get it to run properly. If you'd like, I can send you the code with the fixes that I made.

Transfer Line Attribute tool results in an error

Encountered this error when recently testing out the Transfer Line Attribute table.

Messages
Executing: TransferLineAttributesTool C:\JL\Testing\GNAT\TransferLineAttributes\input.gdb\seg1000m_entiat C:\JL\Testing\GNAT\TransferLineAttributes\input.gdb\nhd100k_entiat LineOID C:\JL\Testing\GNAT\TransferLineAttributes\output.gdb\seg1000m_to_nhd100k C:\JL\Testing\GNAT\TransferLineAttributes\scratch.gdb
Start Time: Tue Jan 03 12:47:14 2017
Running script TransferLineAttributesTool...
GNAT TLA | Branch: 1

Traceback (most recent call last):
  File "<string>", line 353, in execute
  File "C:\dev\geomorphic-network-and-analysis-toolbox\TransferAttributesToLine.py", line 56, in main
    arcpy.Buffer_analysis(lyrToLineBranch,fcToLineBuffer,"10 Meters","FULL","ROUND","ALL")
  File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\analysis.py", line 686, in Buffer
    raise e
ExecuteError: ERROR 999999: Error executing function.
An expected Field was not found or could not be retrieved properly.
An expected Field was not found or could not be retrieved properly. [nhd100k_entiat]
An expected Field was not found or could not be retrieved properly.
An expected Field was not found or could not be retrieved properly. [nhd100k_entiat]
An expected Field was not found or could not be retrieved properly.
An expected Field was not found or could not be retrieved properly. [nhd100k_entiat]
The table was not found. [GNAT_TLA_ToLineBuffer_1]
Failed to execute (Buffer).

Failed to execute (TransferLineAttributesTool).
Failed at Tue Jan 03 12:47:17 2017 (Elapsed Time: 3.00 seconds)

Centerline Tool generates blank feature

Ran Centerline Tool with GNAT v 2.1.12 with the following inputs and settings and received a blank centerline output. There were no error messages in the results messages. The Valley Bottom input was a single part, single feature. I've included the inputs (VB and stream network) and the output (blank Valley Bottom Centerline feature class) in the data below.

vbcenterline_error

vbcenterline_error_results

Data:
ValleyBottomCenterline.zip

Improve error handling for wrong input in the Find Network Errors tool

The Find Network Errors tool requires the network feature class that was output by the Build Network Topology tool (i.e. it has a "_processed" suffix). Currently if that feature class is not an input, it will cause an ugly error. But it should be handled a little more elegantly.

Redesign Calculate Stream Order to better trap errors

Currently the Calculate Stream Order tool still get's stuck in a loop when encountering some unknown issue with an input stream network. The tool either needs to be redesigned, or refactored to better pinpoint what is causing the looping error.

Error rerunning Find Network Features tool after one initial round of preprocess

Steps: Went through the Build Stream Network and Find Network Features process once. Joined the table to the processed stream network layer, found and fixed errors, unjoined the table, then tried to rerun the process to check again for any residual errors. Build Stream Network worked this second time around to create a new stream network feature class with two timestamps, es expected. However, running the Find Network Features tool yielded this error and warning in the last lines of messages:

Error 000732 : Input features: Dataset C:\ISEMP\Networks\UpperSalmon_2Preprocess\Preprocess.gdb\UpperSalmon_EP_2017202_201702021559_201702060939 does not exist or is not supported.
Warning 000725: Output Layer: Dataset in network_fc_lyr already exists.
Failed to execute (MakeLayerFeature).
Failed to execute (FindNetworkFeaturesTool).

Support for multiple networks in watershed

Support of working with multiple networks (disconnected) in one watershed.

Proposals

  1. This could be accomplished through a NetworkID field with one INT per network.
  2. A Network look up table could store the Downstream FID for each network, but must be careful of modified FID's during processing. Alternatively network could contain an IsOutlet or similarly named boolean field.
  3. Downprocess tools would need to be modified to support the use of this enhancement, likely through a simple looping algorithm.

Overwrite or delete StreamNetworkTable when rerunning Build Network Topology Table tool

(From Jean) This tool worked well on the initial run for each network

However, when I ran the tool again after making edits based on the error report, I received an error. The solution was to delete the existing StreamNetworkTable then rerun.

It would be nice if the data in the StreamNetworkTable was overwritten or cleaned automatically out prior to each new run

Project Analysis Issue

Introduction

There is some discrepancy as to how GNAT should be using Analyses within the Riverscapes project. Specifically, GNAT tires to use analyses to store "Segmented Networks", where multiple versions of the same realization could be segmented at different intervals (or different segmentation parameters) (see Analyses section of: https://github.com/SouthForkResearch/gnat/wiki/GNAT_Project). The products of theses Analyses/Segmented Networks would serve as inputs to many other projects/tools.

Issues at Hand

  1. Riverscapes does not support multiple versions of the same type of analysis. https://github.com/Riverscapes/Program/issues/4

  2. @volkcj mentioned that we might add attributes to the segmented network, and keep this within the GNAT project. This would violate the uniqueness of the guid for the network dataset, and does not store that the attribute was added to the network within the project context.

  3. Philip indicated that attribues should be added to the same line network (physical dataset?). The divergence of datasets created by capturing segmentation at the analysis level moves away from this.

Options/Proposals

While it did make some sense to store segmented networks at the analysis level, it is probably worth rethinking how the GNAT project is structured, at least the latter half. What we really need to think about is how GNAT is trying to keep the "family history" of the line network, and how each of the geomorphic attributes are related. In other words, what is GNAT trying to keep track of?

Issue with Build Network Topology Table and ReachID

The Build Network Topology Table tool outputs a feature class with a "_processed" suffix. If this then later serves as input for the Topology Table, the ReachID field will cause a problem when rerunning the tool.

Issue with stream segments using the "Divide remainder" option

(From Jean) when testing out the Segmentation tool with 100 m segs with the "Divide remainder" option. There were some odd segments. For example, one segment was 0.18 m long while it's neighbor was 158.6 m long. The original segment was 158.8 m long. This issue did not appear at this particular segment when the remainder was at the top or when it was at the bottom of the segment

Transfer Line Attributes Issue - failed joins in cross pattern across watershed

During a test run for the Walla Walla watershed, I tested the TLA Tool to have it transfer between the NHD EP Extent layer generated by Jean on 12/2/2016 to the NHD Flowline digitized 4/22/17 and then vice versa. Both are shapefiles projected into North America Albers Equal Area Conic.

In both tests (both directions), I had about 180/14,180 segments in the network fail to join and fail to have the attributes transfer. Aka attributes were not transferred (contain ‘null’ values), and there are null values in the output layer fields “Join_Count”, “TARGET_FID”, “JOIN_FID”, and “Shape_Length_1”. The attribute information from the original "TO" layer is retained, and the new “Shape_Length” field is filled out.

They formed an odd "cross" shape through the middle of the watershed. The data is present in the Dropbox folder below. The original layers used are
NHDFlowline: "NHDFlowline_copy.shp"
NHD_EPExtent: "WallaWalla_NHD_FullExtent_copy.shp"
Outputs: TransferLineAttributes.gdb > "WallaWalla_EPtoNHD", "WallaWalla_NHDtoEP"
https://www.dropbox.com/home/Transfer%20Line%20Attributes%20Tool%20QC

image

Build Network Topology Table throws error with HexSim stream network

....
 Single Reach, 6543
 Single Reach, 6549
Traceback (most recent call last):
 File "<string>", line 488, in execute
 File "C:\dev\gnat\BuildNetworkTopology.py", line 319, in main
   network_tree(downstream_oid,tableNetwork,fcStreamNetworkTemp_lyr,fcNodePoint)
(...multiple calls at line 121...) 
 File "C:\dev\gnat\BuildNetworkTopology.py", line 121, in network_tree
   network_tree(listSelected[0],tblNetwork,fcLines,fcNodePoint)
 File "C:\dev\gnat\BuildNetworkTopology.py", line 58, in network_tree
   arcpy.Delete_management("InputReach")
 File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\management.py", line 3658, in Delete
   raise e
RuntimeError: maximum recursion depth exceeded while calling a Python object

Failed to execute (BuildNetworkTopologyTool).
Failed at Mon Apr 17 14:29:43 2017 (Elapsed Time: 8 minutes 56 seconds)

segmentation error (?)

I've gotten this 'failed to execute' result from all the segmentation runs I've done--here's a screenshot. It seems like it does segment and the script seems to go through until the end, but the failed to execute also appears.

I can provide the network tomorrow as well.
untitled

Fix the "*_processed" suffix on outputs from Build Network Topology and Find Network Errors tools

Currently the Build Network Topology Table and Find Network Errors tools output a copy of the input stream network dataset, with new fields ("IsHeadwater", "ReachID", "IsBraid") and the string "_processed" appended as a suffix to the file name.

However, if the processed output is then used as an input, the "_processed" suffix will be added to the file name again, resulting in a file with a name like "stream_network_processed_processed_processed_processed" after multiple runs of these tools. The suffix should also differentiate between output from the Build Network Topology Table and the Find Network Errors tools.

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.