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

FGDC metadata, step 2 (v1.6.13) #86

Open ecrider-usgs opened 2 years ago

ecrider-usgs commented 2 years ago

Hello, I am trying to use the FGDC metadata script from the most current version and keep getting this error. I've modified the metadata to remove non-ascii characters and tried other modifications to the metadata to see if I could get the script to work with no success. Not sure what I'm getting wrong.

Traceback (most recent call last): File "C:\gems-tools-arcmap-1.6.13\gems-tools-arcmap-1.6.13\Scripts\GeMS_FGDC2_Arc10.py", line 515, in fixObjXML(objName,objType,objLoc,domMR) File "C:\gems-tools-arcmap-1.6.13\gems-tools-arcmap-1.6.13\Scripts\GeMS_FGDC2_Arc10.py", line 439, in fixObjXML dom = copy.deepcopy(domMR) File "C:\Python27\ArcGIS10.8\Lib\copy.py", line 163, in deepcopy y = copier(x, memo) File "C:\Python27\ArcGIS10.8\Lib\copy.py", line 298, in _deepcopy_inst state = deepcopy(state, memo) File "C:\Python27\ArcGIS10.8\Lib\copy.py", line 163, in deepcopy y = copier(x, memo) File "C:\Python27\ArcGIS10.8\Lib\copy.py", line 257, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo) File "C:\Python27\ArcGIS10.8\Lib\copy.py", line 190, in deepcopy y = _reconstruct(x, rv, 1, memo) File "C:\Python27\ArcGIS10.8\Lib\copy.py", line 351, in _reconstruct item = deepcopy(item, memo) File "C:\Python27\ArcGIS10.8\Lib\copy.py", line 163, in deepcopy y = copier(x, memo) File "C:\Python27\ArcGIS10.8\Lib\copy.py", line 298, in _deepcopy_inst state = deepcopy(state, memo) File "C:\Python27\ArcGIS10.8\Lib\copy.py", line 163, in deepcopy y = copier(x, memo) File "C:\Python27\ArcGIS10.8\Lib\copy.py", line 257, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo) File "C:\Python27\ArcGIS10.8\Lib\copy.py", line 163, in deepcopy y = copier(x, memo) File "C:\Python27\ArcGIS10.8\Lib\copy.py", line 298, in _deepcopy_inst state = deepcopy(state, memo) File "C:\Python27\ArcGIS10.8\Lib\copy.py", line 163, in deepcopy y = copier(x, memo) File "C:\Python27\ArcGIS10.8\Lib\copy.py", line 257, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo) File "C:\Python27\ArcGIS10.8\Lib\copy.py", line 190, in deepcopy y = _reconstruct(x, rv, 1, memo) File "C:\Python27\ArcGIS10.8\Lib\copy.py", line 351, in _reconstruct item = deepcopy(item, memo) File "C:\Python27\ArcGIS10.8\Lib\copy.py", line 163, in deepcopy y = copier(x, memo) File "C:\Python27\ArcGIS10.8\Lib\copy.py", line 298, in _deepcopy_inst state = deepcopy(state, memo) File "C:\Python27\ArcGIS10.8\Lib\copy.py", line 163, in deepcopy y = copier(x, memo) RuntimeError: maximum recursion depth exceeded

Failed to execute (MetadataFGDC-2).

ethoms-usgs commented 2 years ago

Could you send me a copy of the XML you are using for the second parameter? Also, in ArcMap, could you open the Python interpreter window and type the following two commands?

import sys
print sys.getrecursionlimit()

and tell me what shows up? The default value is 1000, so I am just curious of that's what yours is set to.

ecrider-usgs commented 2 years ago

Yeah I thought the recursion limit might be set lower for some reason, but it definitely is 1000.

CharlestonSCOFR2013-1030-metadata.zip

ethoms-usgs commented 2 years ago

I looked at this by opening a python prompt and trying to make a deepcopy of the xml file. With the default recursion limit, I got the same error you did. I then started resetting the recursion limit with sys.setrecursionlimit(). 2000 produced the same result and 2500 simply crashed python so I, at least on my laptop of middling quality, can't set the maximum high enough to make a deepcopy of the file. YMMV.

But once I deleted all of your place keywords, I could make the copy with a limit of 1000. I don't know if your XML file is too large overall or if there are just too many children of <place>, but I suspect the latter. I have never seen a metadata file with so many. I would reconsider trying to include them all.