1

I need to create a solution for non-technical people to export data from an ArcMAP document (.mxd) to XML files. I will need each feature's data to be exported in such a way that the output xml file (or could be an Excel file) contains both spatial and non-spatial attributes.

The only I put I see which has the required data is a Google Earth .kmz file. Now, I have been able to convert the .kmz to .kml using some .NET code but the final .kml file is too unstructured to be parsed by my .NET code.

I have tried xToolsPro and they do directly output to .kml file but that doesn't good either--and costs $250 for the license (the export function will expire after the trial).

So what are my options? Could I program some Python script and create some extension to Arctoolbox?

I am stuck! Can't believe this kind of functionally is not built-in (export to xml including Shape data).

  • using ogr2ogr you could automate conversion of all .shp to GML (xml) format without needing your users to do it manually. Then you can parse the GML in .NET – tomfumb Feb 13 '15 at 0:47
  • tomfumb: Interesting. I will check it out. The tool has to be very easy to use--some of the users can be student interns or grad students. Thanks. – IrfanClemson Feb 13 '15 at 12:01
  • your .NET tool could be a standalone or an ArcMap add-in that calls ogr2ogr and then manages the GML output - very user-friendly. However I think you should update your question with what you ultimately want to achieve. You mention parsing the XML for... something. If you describe your end-goal you might find a tool / approach that negates some of the steps – tomfumb Feb 13 '15 at 17:17
  • Tomfumb: Thanks again. But the .NET application will be an ASP.NET application which will parse either xml or kml file and then post to a database. My question is about how to get that file--the only solution I have found is the one at: xtoolspro.com/tools.asp ; it is the only one which outputs from mxd in a structured .kml file which my .NET application is parsing fine. – IrfanClemson Feb 13 '15 at 22:09
1

ESRI has an standard xml format to export both the data and the schema of data.

In ArcCatalg (Catalog window of Arcmap):

1- As arcgis cannot export shapefile directly to XML workspace first import your shapefile into a geodatabase featureclass.

2- right-click the featureCLass > Export> XML Workspace Document

enter image description here

in the opened window there are two combo boxes. select like this snapshot:

enter image description here

I hope it helps.

Update: kmz is the compression format for kml file (like zip format). You need to just extract the kmz to kml using winrar or winzip. Furthermore ArcGIS has a tool to convert a layer including shapefile layer to KMZ (no extra cost!). The Geoprocessing tool name is "Layer to KML".

| improve this answer | |
  • Thanks. But we have the data in .mxd which is fed by .shape files. So where exactly I would see this option? – IrfanClemson Feb 12 '15 at 18:35
  • I updated the answer. in arcmap click the catalog botton to open catalog windows and then locate your shapefile and follow my answer. – Farid Cheraghi Feb 12 '15 at 19:14
  • Farid: Thanks. But these are non-technical people. There will be literally dozens, if not over a hundred buildings, and most buildings will have 'Room Data' and 'Floor Plans' (and possibly other) MXDs--so two MXD's per building. So far, other than xToolsPro, nothing is looking promising. I really appreciate your help though! – IrfanClemson Feb 12 '15 at 19:29
  • Meengla, What I suggested in my answer is just some simple steps. a user can even batch import shapefiles into a geodatabase and then export the whole geodatabase to xml workspace with data. – Farid Cheraghi Feb 12 '15 at 22:01
  • I read your question again, why do you write code to convert kmz to kml?! please See the update answer. – Farid Cheraghi Feb 12 '15 at 22:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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