State Tree Diagram for ArcGIS Pro

4770
10
07-26-2019 05:28 AM
Status: Open
Labels (1)
RayChilcote
Occasional Contributor

The State Tree Diagram was available in the 9.x days.  A work around with the registry key kept it working in 10.x.  Since development has all but ended in traditional desktop, it's time to bring this request forward to ArcGIS Pro.

 

SDE administrators rely heavily on this tool.  Period.  The health of SDE versioning in general is dependent on congruity of the States and the Lineage.  This need will not disappear with ArcGIS Pro or with branch versioning.

 

Esri, plan now.  Work now.  Get this accomplished.

 

To work without the State Tree Diagram is like you having to write code without a computer.  Not very productive, intuitive, or feasible.  For SDE administrators, the State Tree Diagram is a requirement, not a nice-to-have.

 

SDE management.  It's a thing in GIS.

10 Comments
BrianOevermann

I agree with Ray's comments and add that "a picture is worth a thousand words". I don't have the ability to look at the state table and visualize this diagram. I'm not Neo in the Matrix! (bonus points for you if you get the reference)

I'm beginning to wonder if this is a case where the "guy" who originally wrote the code left and now the rest of the team is not knowledgeable enough to understand how to maintain/port it. Esri developers are way more talented for that scenario to be true, so prove me wrong and add it!

JoeBorgione

That was terrific tool.  Never understood why it was abandoned. 

TomLutgen

YES! 

If cost is the issue, we could start a FundMe campaign.  A programmer might come out of the cubicle...

Maybe there are just less people that know about it. I have shown it to many and everyone instantly sees the benefit. 

Did see an attempt in GitHub - haven't tied it.  Not sure if it will give version names, not just State ID.

https://github.com/4andy/state-tree-diagram

Glimmer of hope...

BrianOevermann

I don't want to sound negative, but I've noticed over the years that if someone in the community creates some functionality then Esri will explicitly avoid creating the same or similar functions in the base software. I think it's a legal covering of butts so that there are no possibilities of lawsuits requesting royalties for ideas/code/whatever.

I, for one, will avoid the GitHub project and hope that an Esri-created solution is added to the base software. It's our only hope of having something that just works between version upgrades. And honestly I just want something embedded in the software that doesn't require a separate configuration. We should just be able to right-click on the database connection and have a "Show state tree" item to select.

It occurred to me (too late for this year) that we maybe should create a coordinated effort for anyone going to the User Conference to stop by the ArcGIS Enterprise island (and ArcGIS Pro island for good measure), ask about the state tree diagram functionality, and explicitly request it be added. The employees take notes and if there is this recurring theme of "I want a state tree diagram" then maybe our desire will get elevated/considered. Beats waiting six years for nothing! We might also consider bringing it up in the Pre-Conference Q&A survey comments.

JohnAnderson1

I've been using the custom State Tree Diagram with ArcGIS Desktop for years. I've used the registry hack to get it installed on later versions (currently working with ArcGIS Desktop 10.6.1). Not sure how I'd do my work without it. The tools make it so much easier to get a quick view of the state tree and assess any performance issues. Esri, please add these tools to ArcGIS Pro!

AndrewKniowski1

As has already been mentioned, I created a gp tool to address this that works equally well in Pro and ArcMap. https://github.com/4andy/state-tree-diagram.   Please check it out!

 

As the State Tree Diagram tool for ArcMap hasn't been supported for many years but the visual information is useful, you may find that the tool I created is helpful.  Really, it is just a relatively simple model/script tool in a toolbox and it is very simple to use.  As there are always design limitations with regards to drawing the diagram/labels/symbology etc., I provided the option to import the diagram into the map as features so the user can change the labeling, symbology, and easily explore as desired (or just view the diagram in a window or pdf).  And yes both the states ID's and versions are in the diagram.

 

As it's all open source, you can change the default symbology or colors as desired (there are layer files that control the symbology for imported features).  Let me know what you think or ideas to improve the functionality!

example diagram

RayChilcote

The above tool looks great.  But much like the unsupported GDBT State Tree Diagram tool, it will become dated.  I do not mean to darken this light of sunshine.  When changes come (say Branch Versioning), will this code be updated?  For certain?  If it were part of the product, the answer would be yes.

Esri said it would incorporate the GDBT into the core product.  They did so for 80-90% of the product.  Just not the tool most desired.

It should be in ArcGIS and supported by Esri in future upgrades.

Again, I don't mean to belittle your effort.  The labeling alone is awesome and allows for much more flexibility.  A tall tree is going to apparently snag me.  Large enterprise environment.

NicolasGIS

@AndrewKniowski1 Many thanks for sharing ! Awesome tool. Well documented and working 🙂

I just add a small issue when running it. At first it complained that it could not load a library from an R CRAN repo which in the meantime has closed (http://cran.cnr.berkeley.edu/bin/windows/base/) so I hardcoded the CRAN repo manually in state_tree_graph.R:

options(repos="url_of_the_cran_repo")

I know nothing about R and did not know where the default repo config is located.

Thanks again !

AndrewQuee

@AndrewKniowski1 this was a great tool at release and worked great for a long time.  However things have changed and under 2.9.x  the installation is quite different.  When I finally got R, the bridge and the custom toolboxes installed, I now get this error while running the 'Create state tree diagram' tool:

Create state tree diagram
=====================
Parameters

Database connection file: redacted.sde
Create pdf true
Create features true
View in window true
tree_vertices
tree_edges
=====================
Messages

Start Time: Tuesday, 20 September 2022 3:50:49 PM
Executing (GetStateData): GetStateData

redacted.sde
Start Time: Tuesday, 20 September 2022 3:50:49 PM
Saving temporary files to
C:\Users\aquee\AppData\Local\Temp\ArcGISProTemp16744\StateDiagram_g9fdkh90
Succeeded at Tuesday, 20 September 2022 3:50:53 PM (Elapsed Time: 3.98 seconds)
Executing (CreateStateDiagram): CreateStateDiagram C:\Users\aquee\AppData\Local\Temp\ArcGISProTemp16744\StateDiagram_g9fdkh90 true true true
Start Time: Tuesday, 20 September 2022 3:50:53 PM
URL 'http://cran.cnr.Berkeley.edu/src/contrib/PACKAGES.rds': status was 'Couldn't connect to server'URL 'http://cran.cnr.Berkeley.edu/src/contrib/PACKAGES.gz': status was 'Couldn't connect to server'URL 'http://cran.cnr.Berkeley.edu/src/contrib/PACKAGES': status was 'Couldn't connect to server'unable to access index for repository http://cran.cnr.Berkeley.edu/src/contrib:
cannot open URL 'http://cran.cnr.Berkeley.edu/src/contrib/PACKAGES'package 'igraph' is not available for this version of R

A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packagesURL 'http://cran.cnr.Berkeley.edu/bin/windows/contrib/4.2/PACKAGES.rds': status was 'Couldn't connect to server'URL 'http://cran.cnr.Berkeley.edu/bin/windows/contrib/4.2/PACKAGES.gz': status was 'Couldn't connect to server'URL 'http://cran.cnr.Berkeley.edu/bin/windows/contrib/4.2/PACKAGES': status was 'Couldn't connect to server'unable to access index for repository http://cran.cnr.Berkeley.edu/bin/windows/contrib/4.2:
cannot open URL 'http://cran.cnr.Berkeley.edu/bin/windows/contrib/4.2/PACKAGES'URL 'http://cran.cnr.Berkeley.edu/src/contrib/PACKAGES.rds': status was 'Couldn't connect to server'URL 'http://cran.cnr.Berkeley.edu/src/contrib/PACKAGES.gz': status was 'Couldn't connect to server'URL 'http://cran.cnr.Berkeley.edu/src/contrib/PACKAGES': status was 'Couldn't connect to server'unable to access index for repository http://cran.cnr.Berkeley.edu/src/contrib:
cannot open URL 'http://cran.cnr.Berkeley.edu/src/contrib/PACKAGES'package 'sp' is not available for this version of R

A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packagesURL 'http://cran.cnr.Berkeley.edu/bin/windows/contrib/4.2/PACKAGES.rds': status was 'Couldn't connect to server'URL 'http://cran.cnr.Berkeley.edu/bin/windows/contrib/4.2/PACKAGES.gz': status was 'Couldn't connect to server'URL 'http://cran.cnr.Berkeley.edu/bin/windows/contrib/4.2/PACKAGES': status was 'Couldn't connect to server'unable to access index for repository http://cran.cnr.Berkeley.edu/bin/windows/contrib/4.2:
cannot open URL 'http://cran.cnr.Berkeley.edu/bin/windows/contrib/4.2/PACKAGES'
Number of states 652
Number of versions 16
Error in do.call : could not find function "graph_from_data_frame"
Failed to execute (CreateStateDiagram).
Failed at Tuesday, 20 September 2022 3:51:27 PM (Elapsed Time: 34.09 seconds)
Failed to execute (Model).
Failed at Tuesday, 20 September 2022 3:51:27 PM (Elapsed Time: 38.09 seconds)

The tools for R and the R-Bridge work correctly and report their status/version okay.  Pro notes R configured ok in options.

At first I thought this was some kind of proxy error, it looks like it is either trying to use/sync a graphing function from Berkeley.edu

Looking further, visiting http://cran.cnr.berkeley.edu/bin gives:

CRAN mirror restricted to UC Berkeley
The CRAN mirror at UC Berkeley's College of Natural Resources is no longer available to off campus users and has been removed from the CRAN mirror list. The load on our server was too much.

Berkeley folks can continue to access the mirror from on-campus networks or from within the VPN.

The rest of the R community: Sorry, but you'll have to please choose a different CRAN mirror.

Looks like we slashdotted it. 😞  

How do we either change the tool to point at another CRAN mirror, or even better download the resources into the tool source so it is not reliant on an external site when run?

Congratulations on making a fantastic tool, and helping keep this alive. 🙂

 

ErikLash4

To overcome the Berkeley mirror restriction:

  1. go to the CRAN Mirrors site https://cran.r-project.org/mirrors.html and copy the URL for the mirror of your choosing.
  2. Open state_tree_graph.R (included in the toolbox files folder) in your favorite editor.
  3. Insert the line of code: options(repos="url_of_the_cran_repo")
  4. Save the state_tree_graph.R file.
  5. Run the toolbox in ArcGIS pro.

ErikLash4_0-1668752495724.png