Select to view content in your preferred language

How do you query the dirty area table for specific types of errors?

521
0
07-06-2023 07:20 AM
RobertKrisher
Esri Regular Contributor

Have you ever wanted to look for a specific error type in the utility network, but you weren't sure how to query the dirty areas table? This article has you covered!

The easiest way to get a report of all your errors is to run the Summarize Utility Network Errors tool found in the Utility Data Management Support tools from the ArcGIS Solutions team. But what if you don't want to generate a whole report and just want to query the current dirty areas in your version?

The trick is that each dirty error can represent one or more errors, so the product makes use of something called a bitmask to allow this one field to represent multiple values. If you don't understand what that means, don't worry, I'll show you how you can write a query to find the exact value you want. The trick is we need to tell the database to find features that have the error id is embedded in their error code field (help page), which we can do using the following query:

SQL Server: (CAST(ERRORCODE AS BIGINT) & POWER(2,<Error ID>)) = POWER(2,<Error ID>)
Postgres: (errorcode :: bigint) & POWER(2,<Error ID>) :: bigint = POWER(2,<Error ID>)
Oracle: BITAND(CAST(ERRORCODE AS INTEGER), POWER(2,<Error ID>)) = POWER(2,<Error ID>)
Mobile Geodatabase: (CAST(ERRORCODE AS BIGINT) & POWER(2,<Error ID>)) = POWER(2,<Error ID>)
File Geodatabase: Not Supported (consider using a mobile geodatabase)

Query to find multipart geometries in a mobile geodatabase (error id 21)? st_numgeometries(SHAPE) > 1. You can fix multipart geometries by exploding them. If they just have duplicate vertices you can sometimes use the planarize tool to remove the duplicate vertice.

If you want to see some industry specific blogs or some hands-on tutorial for managing errors check out our recently revitalized Topology Error learn series: https://learn.arcgis.com/en/paths/managing-topology-with-the-arcgis-utility-network/
You can find the online help topic for Error IDs here: https://pro.arcgis.com/en/pro-app/latest/help/data/utility-network/about-error-features.htm#ESRI_SEC...

0 Replies