Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have multiple feature classes in a geodatabase, each feature class has metadata including a Description, Credits, and other information. If I use the 'Add Data' button in ArcMap 10.1 to add one of feature classes then that metadata is imported into the layer description. Ie, I view the layer properties and Description, Credits, etc., are filled in. However, if I use arcpy and add the feature class using MakeFeatureLayer_management and AddLayer then that metadata is not imported.

Does anyone know if its possible to get that full functionality of feature classes and their description, credits, etc to load with arcpy? Am I doing something wrong? Or, must I export the metadata, read the sections I want, and add that text to the layer file?

As requested, a code sample is:

df = arcpy.mapping.ListDataFrames(mxd,"Layers")[0]

The feature class to be inserted in the MXD is 'featureclass_sde' with full metadata. However, once its inserted all metadata is lost. At present I am exporting metadata as XML, parsing XML to get metadata elements (description, source, etc), and then inserting those elements into the MXD. It works but seems so.... wrong....

share|improve this question
I would expect this to work so are you able to post some code for your steps to be tested, please? – PolyGeo May 22 '13 at 21:22
Hey - old post, but did you end up filing this as a bug with ESRI? I'm having this same issue with 10.3.1. Thanks! – Jesse Cleary Jan 22 at 20:20

I agree that this appears to be a bug with AddLayer and so I think you should report it to your local Esri Support.

I was able to reproduce it easily by creating a file geodatabase, creating a feature class within it, and then using Item Description to Edit its Metadata including Credits.

When I drag and dropped this feature class into the map it created a layer that had the Credits on the General tab of its Properties - as expected.

However, when I ran the code below (based on yours) and looked in ArcMap at the layer thus created by AddLayer the expected Credits were missing!

import arcpy

path_to_blankmxd = r"C:\temp\test.mxd"
featureclass_gdb = r"C:\temp\test.gdb\testFC"
activation = "XX2"
layername = "test"
featureclass = "Poly"

df = arcpy.mapping.ListDataFrames(mxd,"Layers")[0]

del mxd
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.