Select to view content in your preferred language

How to access Sum of Shape_Length from of selected/where clause features

130
4
Jump to solution
Monday
SillPaul
Occasional Contributor

We have a number of reports, python scripts, etc. using ST_GEOMETRY queries against versioned views (*_EVW) in our Geometric Network dataset.  Example, against a specific where clause, the query will return SUM(SDE.ST_LENGTH(SHAPE)).

I haven't found any promising replacement yet in our Utility Network test environment.

  • With branch versioning, I don't see a way to do this, since there is no equivalent to the _EVW.
  • I don't believe a query to the REST endpoint can return a sum of  Shape_Length, but I could be wrong on that.
  • I've seen some arcpy examples to cursor through selected features, aggregating the geometric length of each, but with a large (300K+ line records) dataset this is not ideal.

Any ideas on how to accomplish this via some form of automation?  Right-clicking and summarizing shape length in ArcGIS Pro against a selected set isn't a fit either - since the results get formatted into various outputs.

Thank you, UN people.

EDIT:  I suppose my jumping-off point is this:  https://www.esri.com/arcgis-blog/products/utility-network/electric-gas/utility-network-sql/

And this:  https://community.esri.com/t5/arcgis-utility-network-documents/branch-version-sql-views-utility-netw...

 

0 Kudos
1 Solution

Accepted Solutions
MarceloMarques
Esri Regular Contributor
| Marcelo Marques | Esri Principal Product Engineer | Cloud & Database Administrator | OCP - Oracle Database Certified Professional | "In 1992, I embarked on my journey with Esri Technology, and since 1997, I have been working with ArcSDE Geodatabases, right from its initial release. Over the past 32 years, my passion for GIS has only grown stronger." | “ I do not fear computers. I fear the lack of them." Isaac Isimov |

View solution in original post

4 Replies
MarceloMarques
Esri Regular Contributor
| Marcelo Marques | Esri Principal Product Engineer | Cloud & Database Administrator | OCP - Oracle Database Certified Professional | "In 1992, I embarked on my journey with Esri Technology, and since 1997, I have been working with ArcSDE Geodatabases, right from its initial release. Over the past 32 years, my passion for GIS has only grown stronger." | “ I do not fear computers. I fear the lack of them." Isaac Isimov |
SillPaul
Occasional Contributor

Thanks to everyone for suggesting multiple potential solutions.  I'll definitely keep the trace configuration suggestions and Statistics parameter via REST API in mind for future consideration, as these align best with the UN service-oriented approach.

Queries against database views are more in my comfort zone.  Creating the materialized view using sample syntax (Oracle) from this post from Robert Krisher is working well.

Branch Version Sql Views - Utility Network - Esri Community

AyanPalit
Esri Regular Contributor

@SillPaul A conceptual solution will be to use a Trace configuration and use an Add function which will sum the targeted Network Attribute (Shape_Length) as it traces the line features.

AyanPalit_1-1741039809423.pngReview the documentation and the following blog:

Exploring the ArcGIS Utility Network Trace Framework

Ayan Palit | Principal Consultant Esri
jclarke
Occasional Contributor

One more option is to use the outStatistics parameter on the REST API. See this blog: generating-reports-from-the-utility-network

0 Kudos