How to access "item description" metadata?

4416
13
02-17-2016 05:14 AM
by Anonymous User
Not applicable

Hi all,

I was hoping someone could tell me how I can use the ArcGIS Pro SDK to access the item description metadata (abstract/keywords/description etc…) of a feature class?

The example on the Pro Snippets Github page shows how to get a definition object which contains metadata – which I'm doing using the code below:

var featureClass = layer.GetTable() As FeatureClass;

var definition = featureClass.GetDefintion();

But I'm looking at the API page for FeatureClassDefinition – and there doesn't seem to be any way to access the "item description" metadata properties (for example in ArcObjects SDK we used the IMetadata and IXmlPropertySet interfaces).

Can anyone help me out?

Many thanks,

Luke

0 Kudos
13 Replies
curtvprice
MVP Esteemed Contributor

This work is still in the roadmap for 2017, planned for release 2.1.

Hurray!

0 Kudos
RichPriem
New Contributor III

What is the status now at version 2.4.1?

Where in the SDK Data Model can you find/update Metadata for a Layer (including group layer)?

Item.GetXml seems to be result of above discussion, and will retrieve the full Metadata for a Dataset, which can then be modified and saved with Item.SetXml.

However, there is also a Metadata section on the Property Sheet for a generic layer, including Group layers, which do not reference any DataSet.  There are six fields (Title, Tags, Summary, Description, Credits, and Use Limitations) displayed on this Property Sheet.  Note that for Data Layers, select "layer has its own metadata" from the combo box.

CIMBaseLayer has Description and Attribution (Credits), but these do not seem to work.

Core.Item appears to have all six of the above fields, but they do not seem to be populated with the values displayed on the Property Sheet.

0 Kudos
AletaVienneau
Esri Contributor

We still have work to do to provide access to a map layer's metadata in the .NET SDK. It hasn't been completed yet in 2.4.x or 2.5. The issue is in our current product plan for a future release. However, what will be coming in 2.5 is the ability to script metadata workflows via a new arcpy.metadata module, and with that module you will be able to access full metadata for a layer in a map.

- Aleta

LesleyBross1
New Contributor III

We also used the metadata API in ArcMap. As suggested for Pro, I am using the Item class to retrieve the Tags from the metadata. However, I have found a shortcoming with the Tags member. The string in my Tags metadata looks like this when editing in Pro: 'BAGIS Tag < Please do not modify: ZUnitCategory|Elevation; ZUnit|Meters; > End Tag, elevation, blah'. When I use the Tags member through the SDK, it returns this: 'BAGIS Tag < Please do not modify: ZUnitCategory|Elevation, ZUnit|Meters, > End Tag'. Obviously not the same content.

Instead I am using the getXML member to get all of the metadata and then parsing it with the .NET XML library like I did with ArcMap. I know that I am using some special characters in my tags string but it worked under ArcMap so I have to handle legacy metadata. For anyone else wanting to try this, the XPATH string to get at the Tags element is '/metadata/dataIdInfo/searchKeys/keyword'.  Fortunately this did not change between versions. I realize that there is a risk here as ESRI could change the XML schema.