Identify count of dirty areas in a Network Dataset

180
1
05-07-2024 06:53 AM
Labels (1)
Baral_lec
New Contributor

We are using a NAServer to do routing in our Webapp. One can display its Network Dataset via a Map Image Service. I wanted to ask if there is a possibility to query for the count of dirty areas, to know when to build the network again. 

Either via the query-Api in the mapImage Service or via a python call on the ndsobject. 

I tried 

import arcpy
arcpy.CheckOutExtension("network")

nds_path = r"C:\Users\connection.sde\dataset\dataset.ND"

# Initialize the NetworkDataset object
nds = arcpy.nax.NetworkDataset(nds_path)

des = arcpy.da.Describe(nds_path)
dirty=f"{nds_path}_{des['DSID']}_DirtyAreas"
arcpy.da.Describe(dirty) as it worked for people with a utitlity network, however, the last line just returns an error. 

Line 1:     arcpy.da.Describe(dirty)

ValueError: Object: Error in accessing describe

 Any help would be very appreciated.

Thank you very much. 

Best regards 

Dominik

0 Kudos
1 Reply
David_McRitchie
Esri Contributor

Hey Dominik,

It's a very interesting query, but unfortunately, I don't think it is possible to get a total count of the number of dirty areas with Python. 

I was hoping that there might be a method to convert the Dirty Areas into a Feature Class but any methods I have tried result in an incompatibility error.

It therefore might be a better idea to rely on editor tracking for your purposes. If you know the date that the network model was last built, and know the creation date of new features, or features that were updated then this would let you build a count of areas that would Dirty Areas.

Hope that helps,

David

 

 

 

 

 

Esri UK -Technical Support Analyst
0 Kudos