BLOG
|
An important responsibility in data stewardship is delivering metrics that inform stakeholders as to the quality of the data they consume. Many of the questions that data consumers may ask are easily answered when data validation workflows are implemented using Attribute rules. These include: Has the quality of the features I'm working with already been assessed? Are the features in my project area error-free? If no, how severe are the errors in my data and will it impact my work? What type of errors are present in my data? In this blog, we will identify different sources of data quality information that are automatically created when using Attribute rules and capabilities in ArcGIS that assist in increasing awareness of data quality. Dashboard charts Attribute rules allow you to evaluate a feature’s quality based on requirements implemented as a series of validation rules. Evaluation is done on an as-needed basis either interactively using the Error Inspector in ArcGIS Pro, as a step in an automated workflow using the Evaluate Rules geoprocessing tool, or using Evaluate REST operation. Error features are created when a feature fails to meet the criteria implemented in the validation attribute rule. In this example, error features are leveraged using ArcPy to provide a dashboard chart that summarizes error information based on a field. Some of the common fields include the error lifecycle phase or status, severity, or rule name. First, the script queries all error layers in the geodatabase based on the provided field. Once the geodatabase path and a field name are passed in the “make_combined_list” function, it returns a list of error results: Note : This script uses the Matplotlib python library available with ArcGIS Pro. def make_combine_list(gdb, field):
Occurances = []
with arcpy.da.SearchCursor (gdb + "\\GDB_ValidationPointErrors", field) as cursor:
for row in cursor:
Occurances.append (row[0])
with arcpy.da.SearchCursor (gdb + "\\GDB_ValidationLineErrors", field) as cursor:
for row in cursor:
Occurances.append (row[0])
with arcpy.da.SearchCursor (gdb + "\\GDB_ValidationPolygonErrors", field) as cursor:
for row in cursor:
Occurances.append (row[0])
with arcpy.da.SearchCursor (gdb + "\\GDB_ValidationObjectErrors", field) as cursor:
for row in cursor:
Occurances.append (row[0])
return Occurances Once the list is created with all the results combined at one place then we find the unique count and values based on those results. These values are then used to label the dashboard chart. The “get_unique_count” functions take two parameters, a list and a bool if count required “true” or “false” and returns a list of unique values if bool is false and a list of count of unique values if bool is true: def get_unique_count(list, Is_Count):
unique_values = []
count = []
for i in list:
if i not in unique_values:
unique_values.append(i)
for i in unique_values:
count.append (list.count(i))
if Is_Count == True:
return count
else:
return unique_values If the field value is “Error status”, which uses a coded value domain, the codes must be replaced by the description value to get a better understanding in the chart. To do this, we pass the list of unique values to replace function and it will return a list with the description value. This logic can be used with any coded domain value field i.e. Life def replace(list_unique_values):
for i in range(len(list_unique_values)):
if list_unique_values [i] == 1:
list_unique_values [i] = "Reviewed"
elif list_unique_values [i] == 2:
list_unique_values [i] = "Resolved"
elif list_unique_values [i] == 3:
list_unique_values [i] = "Mark As exception"
elif list_unique_values [i] == 4:
list_unique_values [i] = "Acceptable"
elif list_unique_values [i] == 6:
list_unique_values [i] = "Unacceptable"
elif list_unique_values [i] == 9:
list_unique_values [i] = "Exception"
return list_unique_values Once we get the unique field values and counts, we pass this info to the Matplotlib object to draw the chart. Accuracy report of your data The goal of this report is to increase awareness by providing a summary of your data’s accuracy that can be leveraged by multiple stakeholders in your organization. In Attribute rule workflows, each feature’s status is automatically maintained and indicates whether it requires calculation, validation and if it is in error. In this example, error information is stored in the features themselves and the script checks for the presence of the ValidationStatus field in every feature class. When found, it calculates the dataset’s accuracy based on the value of that field in each feature. For example, in a feature class with 100 features, 70 of them do not require validation and contain errors (ValidationStatus equals 1, 3, 5 or 7) and 30 of them require validation and do not contain errors (ValidationStatus equals 2 or 6) then the calculated percentage accuracy ((1 - (total_errors / total_feature_count)) * 100) of that feature class is 70% with a margin of error of 30%. Note : This script uses the Tabulate python library to format the accuracy report which is not installed by default with ArcGIS Pro. def calculate_percentage_accuracy(gdb):
fcname = []
accuracy = []
featurecount = []
errorcount = []
marginoferror = []
arcpy.env.workspace = gdb
datasets = arcpy.ListDatasets(feature_type='feature')
datasets = [''] + datasets if datasets is not None else []
for ds in datasets:
for fc in arcpy.ListFeatureClasses(feature_dataset=ds):
totalcount = int(arcpy.GetCount_management(fc).getOutput(0))
for field in arcpy.ListFields(fc):
if("VALIDATIONSTATUS" in field.name.upper()):
a = 0
b = 0
with arcpy.da.SearchCursor(fc,field.name) as cursor:
for row in cursor:
if(1 in row or 3 in row or 5 in row or 7 in row):
a = a + 1
elif(2 in row or 6 in row):
b = b + 1
percentacc = (1 - (a / totalcount)) * 100
fcname.append(fc)
accuracy.append(round(percentacc, 1))
featurecount.append(totalcount)
errorcount.append(a)
if b == 0:
M_err = 0
else:
M_err = (b / totalcount) * 100
marginoferror.append(round(M_err, 1))
return fcname, accuracy, featurecount, errorcount, marginoferror To learn more about Python in ArcGIS Pro, python libraries used in this script and Attribute rules please follow the links below: Python in ArcGIS Pro https://pro.arcgis.com/en/pro-app/latest/arcpy/get-started/installing-python-for-arcgis-pro.htm What is ArcPy? https://pro.arcgis.com/en/pro-app/latest/arcpy/get-started/what-is-arcpy-.htm Introduction to attribute rules https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/overview/an-overview-of-attribute-rules.htm Evaluation of features using Reviewer rules https://pro.arcgis.com/en/pro-app/latest/help/data/validating-data/evaluation-of-features-using-reviewer-rules.htm Manage attribute rule errors https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/overview/manage-attribute-rule-errors.htm Matplotlib python library https://matplotlib.org Tabulate python library https://pypi.org/project/tabulate
... View more
07-08-2021
02:38 PM
|
6
|
0
|
1858
|
POST
|
Hi Sachin and Lindsey, If I understand this problem correctly, you are trying to find all water lateral points that intersect with Water Pipe only. I would suggest a composite check with the following config: Check1 : Feature on Feature FC1 - Lateral Point FC2 - Water laterals Spatial Relation : Intersect Not : true Check2 : Feature on Feature FC1 - Lateral Point FC2 - Water Pipe Spatial Relation : Intersect Not : false The output of this composite check will be Lateral Points that do no intersect with Water Laterals but intersect with Water Pipe. Hope this helps. Thanks, Kumar Gaurav
... View more
10-07-2020
03:14 PM
|
0
|
1
|
563
|
POST
|
Hi Lindsey, We cannot achieve what you are looking for using one Data Reviewer check but you can use the following approach to resolve this issue. 1. Use Data Reviewer Feature on Feature Rule to find intersecting points for Lateral and Main. Make sure you only have errors from this check in your Reviewer workspace. 2. Use Export Data Reviewer Records to Shapefile tool from the MDRR python toolbox and create a point shapefile for intersection points of Lateral and Main. 3. Use this point shapefile and run Data Reviewer Composite check as follows : Intersection points not intersecting with fittings Intersection points not intersecting with valves 4. Output of this check is a set of points that intersect with laterals which has this problem you are looking for. Hope this helps. Thanks, Kumar
... View more
10-01-2020
09:37 AM
|
0
|
0
|
624
|
POST
|
Hi Djurra, I quickly tested the scenario you mentioned with a sample data in ArcMap 10.7.1 but I am getting expected results, please refer to the video showing the workflow: However, I don't see a value in using the "Always Run on Full Database" option if you are planning to use a Definition Query and same feature class a secondary. About the Update you mentioned that you are only seeing this issue when you run it multiple times, I also tried that scenario, but I am not able to reproduce that as well. Please refer to the video below to see that workflow: It seems this issue is specific to your Data, I would suggest you to please contact Esri Technical Support so that they can work with you to further troubleshoot this issue. Thanks, Kumar Gaurav
... View more
08-28-2020
11:46 AM
|
0
|
1
|
903
|
POST
|
Hi Vu Tuan, I tested the option in ArcMap 10.7.1 and it worked for me: I got 2 results which are not validated by this expression. Can you please confirm, what did not worked in your case? Thanks, Kumar Gaurav
... View more
08-17-2020
09:25 AM
|
0
|
1
|
991
|
POST
|
Hi Vu Tuan, Please use the following expression to find values in format : 6636-V-DN ([0-9][0-9][0-9][0-9]-[A-Z]-[A-Z][A-Z]) To find NULL values or an empty string values please add another Execute SQL Check check against the same field with the following expression: <field name> IS NULL OR <field name > = " " Thanks, Kumar Gaurav
... View more
08-16-2020
04:22 PM
|
0
|
4
|
992
|
POST
|
Hi Shannon, You can use the Batch Job created in 10.4.1 in 10.7.1 with no issues. But if you want to upgrade the batch job version, open it in ArcMap 10.7.1 Batch Job Manager and save it. Your batch job will be upgraded to 10.7.1 version. For the difference in number of errors between two versions, please check some of the new errors you are getting in 10.7.1 and confirm if they are correct. My guess is because of the bugs resolved in between versions(10.5 - 10.7.1), you are now getting more accurate results. Please let me know if this is the case or you are getting incorrect results. Thanks, Kumar Gaurav
... View more
08-13-2020
05:17 PM
|
0
|
0
|
532
|
POST
|
Hi Steven, Which Data Reviewer Constraint Rule are you trying to configure and what are the parameters used when you experienced this error? Thanks, Kumar Gaurav
... View more
08-11-2020
09:40 AM
|
0
|
1
|
1409
|
POST
|
Hi Steven, The workflow that you used is correct for the scenario you mentioned. I quickly tested the same where you shared a Map File with editors and they are editing on their respective versions and then run the Reviewer Rules. However, when I executed my Map rules against the child version. I am getting expected results. Please see the video below: Thanks, Kumar
... View more
06-22-2020
09:39 AM
|
0
|
1
|
1025
|
POST
|
Hi Susan, I tested with sample utility data on SQL Server database by creating a new batch job with some checks like Valency, Domain, Execute SQL etc. but I am not able to reproduce this issue. When I switch to different version I always get my database name stored in lower case in Batch Validation workspace dialog. This issue may be specific to your workflow, I would suggest you to please contact Esri Technical Support. They can work with you to get a reproducible scenario and help you resolve this issue. Thanks, Kumar
... View more
05-13-2020
08:09 AM
|
0
|
1
|
972
|
POST
|
Hi Susan, I tried locally with SQL server database and Execute SQL checks but I am not able to reproduce this behavior. Can you please provide me some more info to reproduce the same. Type of checks which are not working Check configuration It will be helpful if you can share a small subset of data with batch jobs to reproduce this issue. Thanks, Kumar
... View more
05-04-2020
09:06 AM
|
0
|
1
|
972
|
POST
|
Hi Terri, You can run these batch jobs using python scripts as long as you have sufficient number of licenses available as each python script will checkout one Data Reviewer license and execute the GP tool. I quickly tried with 4 batch files calling Execute Reviewer Batch Job GP tool at the same time and I did not experience any issue. So if you are getting any time outs or other issues please check other things like database connections, batch job execution permissions which might be causing these problems. One more suggestion is to log GP messages and other custom messages in a .txt file to see if anything come up.
... View more
04-21-2020
10:10 PM
|
1
|
1
|
712
|
POST
|
Hi Bryce, You can use Geometry on Geometry check with "Touches" as spatial relation and use "Not" option. Use Point as Feature class 1 and Line as Feature class 2. For more info about this check please refer to the following web help topic: Finding geometries with spatial relationships—Help | Documentation Thanks, Kumar
... View more
03-28-2020
01:29 PM
|
1
|
1
|
665
|
POST
|
Hi Bryce, I tried similar configuration with my sample data and Geometry on Geometry check with Touches option worked for me: You can use same configuration in ArcGIS Pro as well. Hope this helps. Thanks, Kumar
... View more
03-03-2020
01:24 PM
|
1
|
1
|
561
|
POST
|
Hi M D Johnson, Data Reviewer check uses the ATL regular expression engine, so some of the metacharacters have a different meaning in ATL regular expressions., however you can achieve the results mentioned in the post using the following regular expression : [0-9][0-9]L For more reference please see the following help topic: Validating string values—Help | ArcGIS Desktop Thanks, Kumar
... View more
01-13-2020
08:56 AM
|
2
|
0
|
553
|
Title | Kudos | Posted |
---|---|---|
6 | 07-08-2021 02:38 PM | |
1 | 03-03-2020 01:24 PM | |
1 | 09-20-2019 02:34 PM | |
1 | 09-26-2019 08:43 AM | |
1 | 04-21-2020 10:10 PM |
Online Status |
Offline
|
Date Last Visited |
03-13-2024
07:23 PM
|