DOI-USGS / gems-tools-arcmap

Tools for working with the GeMS geologic map database schema in ArcGIS
Creative Commons Zero v1.0 Universal
42 stars 21 forks source link

Translate to Shapefile #90

Closed aldunn4 closed 1 year ago

aldunn4 commented 1 year ago

At the end of last year, when running the Translate to Shapefile tool in ArcMap, we got an error about the StandardLithology table. I had posted on Gitter in hopes of a quick answer as we were running up against a deadline, but I just now got around to trying the recommended fix. I did get the tool to work either by removing the StandardLithology table, as it is not required, or by populating it with data. I have noticed the tool still produces a shapefile for other empty feature classes and tables though. I know there are groups meeting about additional as-needed tables that can be added to GeMS for geochemistry, geophysics, engineering, land classification, etc. Can this tool be made so it skips over any empty feature class or table, even if it's optional?

ethoms-usgs commented 1 year ago

I just pushed a new version of the toolbox. Download it from the green Code button on the landing page, not from the Releases section. I can't open ArcMap right now for some to test it so let me know and if that works as a fix, I will make a new release.

aldunn4 commented 1 year ago

I just did that and got this message with a gdb with an empty StandardLithology table.

Executing: TranslateToShape D:\Shapefiles\NewMexicoGeologicMap.gdb D:\Shapefiles\NewMexico Start Time: Wed Apr 5 12:18:34 2023 Running script TranslateToShape... GeMS_TranslateToShape_Arc10.py, version of 5 March 2023 Copying NewMexicoGeologicMap.gdb to temporary geodatabase Making D:\Shapefiles\NewMexico\NewMexicoGeologicMap-simple... Making StdLith dictionary... Failed script TranslateToShape...

Traceback (most recent call last): File "D:\gems-tools-arcmap-master\Scripts\GeMS_TranslateToShape_Arc10.py", line 463, in main(newgdb, ows, gdb) File "D:\gems-tools-arcmap-master\Scripts\GeMS_TranslateToShape_Arc10.py", line 375, in main stdLithDict = makeStdLithDict() File "D:\gems-tools-arcmap-master\Scripts\GeMS_TranslateToShape_Arc10.py", line 278, in makeStdLithDict unit = row.getValue('MapUnit') AttributeError: 'NoneType' object has no attribute 'getValue'

Failed to execute (TranslateToShape). Failed at Wed Apr 5 12:18:42 2023 (Elapsed Time: 7.08 seconds)

ethoms-usgs commented 1 year ago

Ah, I see the problem (hopefully). Try again, I just pushed another version.

aldunn4 commented 1 year ago

A new error this time! I can provide the whole results if necessary this is just the last thing it said with the errors.

... Processing feature data set CorrelationOfMapUnits... 7 feature classes in here CartographicLines Dumping COMU_CMUMapUnitPolysLabels.shp... Finished dump Dumping COMU_CMUMapUnitPolys.shp... Finished dump Dumping COMU_CMUMapUnitPoints.shp... Finished dump Dumping COMU_CMUGeochronPoints.shp... Finished dump Dumping COMU_CMUContactsAndFaults.shp... Finished dump Dumping COMU_CMUCartographicLines.shp... Finished dump Dumping COMU_CMUMapUnitLines.shp... Finished dump Failed script TranslateToShape...

Traceback (most recent call last): File "D:\gems-tools-arcmap-master\Scripts\GeMS_TranslateToShape_Arc10.py", line 463, in main(newgdb, ows, gdb) File "D:\gems-tools-arcmap-master\Scripts\GeMS_TranslateToShape_Arc10.py", line 439, in main if arcpy.GetCount_management(tb) > 0: NameError: global name 'tb' is not defined

Failed to execute (TranslateToShape). Failed at Wed Apr 5 13:11:05 2023 (Elapsed Time: 9 minutes 0 seconds)

ethoms-usgs commented 1 year ago

Arg, typo. Fixed it. Try again. Sorry for the back and forth, but ArcMap is still not opening for me.

aldunn4 commented 1 year ago

It worked, thank you!

ethoms-usgs commented 1 year ago

Good to hear! I will close this issue.