Select to view content in your preferred language

ArcGIS Pro: read metadata from map with arcpy

1126
2
Jump to solution
02-06-2020 09:33 AM
LukasWürsch
Regular Contributor

Hi there

I would like to access metadata information (such as tags and descriptions) which are stored in a Map with arcpy. 

According to the documentation, Map class has a metadata attribute, however if I try to access it within ArcGIS Pro I get AttributeError: 'Map' object has no attribute 'metadata'. I tried the following:

aprx = arcpy.mp.ArcGISProject("Current")
map = aprx.listMaps()[0]
map.metadata

(other attributes of Map can be accessed like this)

Am I doing something wrong or is it not possible to access the metadata information like this? Is there currently another way to access metadata information with arcpy or do we have to wait for ArcGIS Pro 2.5 for this functionality? 

 

Any help or hints would be very appreciated

0 Kudos
1 Solution

Accepted Solutions
LorneDmitruk2
Regular Contributor

Hi Lukas,

Hi Lukas,

 

The online help always defaults to the latest version of the software. I'm running 2.4.3 and i just tried getting the metadata from a map and got the same result. In addition I check using the python help function and only found the following descriptors:

| Data descriptors defined here:
 | 
 | defaultCamera
 | 
 | defaultView
 | 
 | mapType
 | 
 | mapUnits
 | 
 | name
 | 
 | referenceScale

So I would guess for the map class the metadata property is new with 2.5.

View solution in original post

2 Replies
LorneDmitruk2
Regular Contributor

Hi Lukas,

Hi Lukas,

 

The online help always defaults to the latest version of the software. I'm running 2.4.3 and i just tried getting the metadata from a map and got the same result. In addition I check using the python help function and only found the following descriptors:

| Data descriptors defined here:
 | 
 | defaultCamera
 | 
 | defaultView
 | 
 | mapType
 | 
 | mapUnits
 | 
 | name
 | 
 | referenceScale

So I would guess for the map class the metadata property is new with 2.5.

LukasWürsch
Regular Contributor

Thank you for the answer, just noticed that 2.5 was recently released. I updated to the new version, now it works