ArcPy solution to export graph as xml

2161
3
02-07-2016 04:42 PM
DavidGaworski1
New Contributor

I'm looking for a way to export a stack profile graph as an xml. Just like this Exporting the graph data—Help | ArcGIS for Desktop  but through the use of python.

0 Kudos
3 Replies
DanPatterson_Retired
MVP Emeritus

the only arcpy access to graphing is here Graph—Help | ArcGIS for Desktop

If you want a python solution, then recent installs of arcmap include matplotlib which offers huge capabilities and integrating with gis data is a breeze  matplotlib: python plotting — Matplotlib 1.5.1 documentation

DavidGaworski1
New Contributor

Dan,

I already built some code, before realizing you could not automate xml export from graph, to parse the data from the xml export to analyze the topographic profile. This code uses ElementTree along with Matplotlib but I wasn't wanting to change the code since the xml export comes out formatted really nice. I hopping for a quirky work around for this solution.

Thanks though.

0 Kudos
XanderBakker
Esri Esteemed Contributor

If you extract the values of your profile using numpy, you can give it any format you like and analyze it the way you want: see: Extract Raster Values using Numpy