Closed alwunder closed 1 year ago
Good point. You should be able to use the tool on incomplete databases. I am surprised you got that far because when I deleted those three tables from a gdb, the tool bombed out much earlier. Anyway, I add some tests and got it to run to completion. In the cases where those tables are missing, many rules are irrelevant (I think? please let me know) and so the rule is not even checked.
To try this out, download from the green Code button, not the latest release. I will tag and post a new release if/when we get this worked out.
Well, the tables are not deleted, they are simply empty. Not sure if that makes a difference. I will try to download again as you suggested. It'll get worked out!
Ok, that would. I will need to work on that.
OK, I just tested the latest version (2.11.3; copy pasted code directly from the Code page) again on the same incomplete database, and it finished, no problem! It recognized the empty tables and reported the missing entries in the DMU and Glossary tables, as expected:
2.4 MapUnits missing from DMU. Only one reference to each missing unit is cited
Mm, field MapUnit, table MapUnitPolys
Mfp, field MapUnit, table MapUnitPolys
Msl, field MapUnit, table MapUnitPolys
Mw, field MapUnit, table MapUnitPolys
Sbr, field MapUnit, table MapUnitPolys
Os, field MapUnit, table MapUnitPolys
Olcy, field MapUnit, table MapUnitPolys
2.6 Missing terms in Glossary. Only one reference to each missing term is cited
table ContactsAndFaults, field IdentityConfidence, certain
table ContactsAndFaults, field ExistenceConfidence, unspecified
table ContactsAndFaults, field IdentityConfidence, unspecified
table ContactsAndFaults, field ExistenceConfidence, certain
table ContactsAndFaults, field Type, contact approximate
table ContactsAndFaults, field Type, contact accurate
table MapUnitPolys, field IdentityConfidence, certain
table ContactsAndFaults, field Type, map neatline
2.8 Missing DataSources entries. Only one reference to each missing entry is cited
MapUnitPolys, field DataSourceID, TGSGQM_087NW_002
ContactsAndFaults, field DataSourceID, USGSMAPINDEX
ContactsAndFaults, field DataSourceID, TGSGQM_087NW_002
However, it is still tripping up on the Anno classes:
2.1 Missing required elements
Feature class ContactsAndFaultsAnno
2.2 Missing or mis-defined fields
MapUnitPolysAnno missing field MapUnit
MapUnitPolysAnno missing field IdentityConfidence
MapUnitPolysAnno missing field Label
MapUnitPolysAnno missing field Symbol
MapUnitPolysAnno missing field DataSourceID
MapUnitPolysAnno missing field MapUnitPolysAnno_ID
Getting closer now!!
Is MapUnitPolysAnno an Arc-generated annotation class? The tool currently excludes annotation based on the 'featureType' property of a Describe object so it should be getting tagged as "Annotation"
Yes, it is generated in ArcGIS Pro from the Maplex label engine, converted to annotation. I ran a bit of code in ArcGIS Pro Python window just to check:
import arcpy
# Get the layer as a parameter and describe it.
layerString = "MapUnitPolysAnno"
desc = arcpy.Describe(layerString)
# Print selected layer and describe object properties
print("Name: {}".format(desc.name))
if hasattr(desc, "layer"):
print("Layer name: {}".format(desc.layer.name))
print("Layer data source: {}".format(desc.layer.catalogPath))
print("Feature type: {}".format(desc.layer.featureType))
else:
print("Layer name: {}".format(desc.name))
print("Layer data source: {}".format(desc.catalogPath))
print("Feature type: {}".format(desc.featureType))
Name: MapUnitPolysAnno
Layer name: MapUnitPolysAnno
Layer data source: C:\GIS\PROJECTS\FY2022 STATEMAP Project\BelvidereTN_GeologicMap\BelvidereTN_GeologicMap.gdb\CartographicElements\MapUnitPolysAnno
Feature type: Annotation
Ok, could you double-check that the file GeMS_utilityFunctions.py in Scripts looks like this?
In particular, def gdb_object_dict(gdb_path)
starting on line 282?
Alright! I double checked and refreshed the GeMS_utilityFunctions.py and it is now working: no trip-ups on the Annotation and the results are as expected, giving me lists of missing items so I can build my tables.
Awesome work, Evan! Thank you!!
Testing the newest version on an incomplete database (complete except for DMU, Glossary, and DataSources table) and get the following error:
It seems at least this time I am getting errors on valid lines...
I also ran the tool on a finished database that passed previous validations and the tool runs to completion without error.
UPDATE: Adding commented lines to the code causes the error to move around, so I am relatively confident that the script is running form the most recent file and not caching.