What is an APRX file?: Difference between revisions

From Wildsong
Jump to navigationJump to search
Brian Wilson (talk | contribs)
Created page with "Can I open an APRX in QGIS? https://gis.stackexchange.com/questions/335915/opening-arcgis-pro-project-aprx-in-qgis (Spoiler: NO!) == What is CIM? == There are lots of references using the letters C-I-M in the component files. What is CIM and where is it documented? It stands for "Cartographic Information Model" and it's described here: https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic44.html Access from '''Python''' https://pro.arcgis.com/en/pro-app/lat..."
 
Brian Wilson (talk | contribs)
 
(3 intermediate revisions by the same user not shown)
Line 4: Line 4:
There are lots of references using the letters C-I-M in the component files. What is CIM and where is it documented?
There are lots of references using the letters C-I-M in the component files. What is CIM and where is it documented?


It stands for "Cartographic Information Model" and it's described here: https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic44.html
It stands for "Cartographic Information Model" and it's described here: https://github.com/Esri/cim-spec
 
The API is described here https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic44.html


Access from '''Python''' https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/python-cim-access.htm via ArcPy. Na. Can't install that on my web server.
Access from '''Python''' https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/python-cim-access.htm via ArcPy. Na. Can't install that on my web server.
Line 12: Line 14:
Description https://community.esri.com/t5/arcgis-pro-sdk-blog/arcgis-pro-cim-viewer/ba-p/883598
Description https://community.esri.com/t5/arcgis-pro-sdk-blog/arcgis-pro-cim-viewer/ba-p/883598


Git repo https://github.com/Esri/arcgis-pro-sdk-cim-viewer It's copyright Esri but Apache License.  
Git repo https://github.com/Esri/arcgis-pro-sdk-cim-viewer It's copyright Esri but Apache License.
 
Here is a doc you might find enlightening about CIM, search for "" https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/updatingandfixingdatasources.htm See "Updating data sources via the CIM"
 
Is there some nice nonproprietary CIM reader Python code out there? There is a scrap of code in the Esri JavaScript API to work wth CIMSymbols.


== What is in an APRX? ==
== What is in an APRX? ==
It's a zip file. "Unzip" these days is smart enough to not make me rename the file. So, "unzip afile.aprx"...
It's a zip file. "Unzip" these days is smart enough to not make me rename the file. So, "unzip afile.aprx"...


Generally speaking, a bunch of folders and a bunch of XML files. There is a folder for each map and probably one for each layout.
Generally speaking, a bunch of folders and a bunch of XML files.  
There is a folder for each map and probably one for each layout.
There are JSON files.


There are JSON files.
After digging in deeper I am starting to think the reason it's not documented is that they are embarrassed at how messy it is. Files and folders sometimes seem to be debris.


=== XML files ===
=== XML files ===
Line 38: Line 46:
The "map" folder has an XML file containing a CIMMap document for each map, for example "map9.xml" describes a map called "NAIP 2020".
The "map" folder has an XML file containing a CIMMap document for each map, for example "map9.xml" describes a map called "NAIP 2020".


There are ground*.json files that describe the ground elevation for each map, probably.  
There are a series of "ground[1-9].json" files that describe the ground elevation for each map, probably.  


There are other files in "map" that appear wayward and out of place, such as a few layers like "parks.xml" which is a CIMFeatureLayer. BUG?
There are other files in "map" that appear wayward and out of place, such as a few layers like "parks.xml" which is a CIMFeatureLayer. BUG?
Line 46: Line 54:
=== "Layout" folder ===
=== "Layout" folder ===
"layout" has an XML for each layout. They are '''CIMLayout''' documents.
"layout" has an XML for each layout. They are '''CIMLayout''' documents.
=== Random other folders ===
==== "Metadata" folder ====
N * <hash>.xml where each XML file contains some metadata for something. The hash must be referenced somewhere?
I love the tag "CreaTime", like "CreateTime would have been just too long? Probably a DOS or UNIX programmer felt a need to restrict it to 8 characters.
==== Pictures ====
"Pictures" has a picture in it, in this case it's a BMP of the county logo. I wonder if it's a thumbnail.
"Thumbnails" has <hash>.dat files in it. I am sure they are some super secret Esri proprietary image format. PNG is not good enough for us.

Latest revision as of 21:39, 13 September 2023

Can I open an APRX in QGIS? https://gis.stackexchange.com/questions/335915/opening-arcgis-pro-project-aprx-in-qgis (Spoiler: NO!)

What is CIM?

There are lots of references using the letters C-I-M in the component files. What is CIM and where is it documented?

It stands for "Cartographic Information Model" and it's described here: https://github.com/Esri/cim-spec

The API is described here https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic44.html

Access from Python https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/python-cim-access.htm via ArcPy. Na. Can't install that on my web server.

There is this CIM Viewer thing but it's an add-on for ArcGIS Pro, that is no fun at all. Actually it looks like it's very cool.

Description https://community.esri.com/t5/arcgis-pro-sdk-blog/arcgis-pro-cim-viewer/ba-p/883598

Git repo https://github.com/Esri/arcgis-pro-sdk-cim-viewer It's copyright Esri but Apache License.

Here is a doc you might find enlightening about CIM, search for "" https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/updatingandfixingdatasources.htm See "Updating data sources via the CIM"

Is there some nice nonproprietary CIM reader Python code out there? There is a scrap of code in the Esri JavaScript API to work wth CIMSymbols.

What is in an APRX?

It's a zip file. "Unzip" these days is smart enough to not make me rename the file. So, "unzip afile.aprx"...

Generally speaking, a bunch of folders and a bunch of XML files. There is a folder for each map and probably one for each layout. There are JSON files.

After digging in deeper I am starting to think the reason it's not documented is that they are embarrassed at how messy it is. Files and folders sometimes seem to be debris.

XML files

I hate XML files, BTW. :-)

Several <hash>.xml files. They appear to describe different basemap services. (Grey, OSM, etc)

The DocumentInfo.XML file contains a CIMDocumentInfo which has an erroneous out of date DocumentTitle in it. I wonder where that shows in Pro? It has other project settings like "UseRelativePath = true".

JSON files

<hash>.json (in this example, 29a99abb376643b596115891928364c8.json) This one appears to describe my aerial photo service.

Index.json -- Looks like a manifest of all the files, gold mine of information, whoo hoo, It is not a CIM document.

GISProject.json -- looks like the top level view of the Project. There is a crazy amount of gunk in here. API doc: https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic1835.html

Map Folders

The "map" folder has an XML file containing a CIMMap document for each map, for example "map9.xml" describes a map called "NAIP 2020".

There are a series of "ground[1-9].json" files that describe the ground elevation for each map, probably.

There are other files in "map" that appear wayward and out of place, such as a few layers like "parks.xml" which is a CIMFeatureLayer. BUG?

Each map folder contains a JSON file describing each layer in the map. And maybe occasionally an XML file too. There are probably competing teams at Esri, and the grey beards prefer XML.

"Layout" folder

"layout" has an XML for each layout. They are CIMLayout documents.

Random other folders

"Metadata" folder

N * <hash>.xml where each XML file contains some metadata for something. The hash must be referenced somewhere?

I love the tag "CreaTime", like "CreateTime would have been just too long? Probably a DOS or UNIX programmer felt a need to restrict it to 8 characters.

Pictures

"Pictures" has a picture in it, in this case it's a BMP of the county logo. I wonder if it's a thumbnail. "Thumbnails" has <hash>.dat files in it. I am sure they are some super secret Esri proprietary image format. PNG is not good enough for us.