[GIS] How to open XML files in ArcGIS

arcgis-desktopconvertfmexml

I am attempting to use XML files, for example Google places API extracted XML files, in ArcGIS 10.4/10.5, and have yet to find an easy way to do so. I do not know what type of XML file it is exactly, I do know that it contains longitude/latitude data. I have attached a pic of the start of the code, if that helps to identify.

enter image description here

So far I have succeeded to convert an XML file to a shapefile through the Add X,Y feature in ArcGIS which turns the file into an Excel file, and then using the FME converting software to convert the Excel file into a working shapefile. This is a rather long way, and takes some time if I want to work with a large number of XML files.

Is there an easier way to do so? Otherwise, is there an easier way to work on spatial features with XML files than ArcGIS?

Best Answer

Well, since you have FME I would suggest using that to convert the XML directly to a Geodatabase or Shapefile.

Use FME Workbench and generate a workspace. For the Reader set the format to XML and choose the datafile. Click the Parameters button.

Under parameters click the browse button next to Elements to Match and choose the header element (probably PlaceSearchResponse in your case).

Set the Writer to be Geodatabase or Shapefile.

When the workspace is created the XML should be "flattened" into attributes; i.e. you should get attributes like PlaceSearchRespose.Result.Geometry.Lat/Lng (or similar).

You can use a VertexCreator transformer to turn those attributes into geometric features. You'll also want to check the writer feature type parameters to make sure the table/layer is expecting the right geometry (points).

Then run the translation.

(Quick demo, bearing in mind I don't have the right dataset: https://screencast.com/t/SUGcQ20sQFOc)

Since you have both FME and ArcGIS, you could also activate the FME Extensions in ArcGIS, and carry out the above fully in ArcGIS using a Spatial ETL Model instead of an FME Workspace. See the FME documentation (especially the Data Interoperability Extension) for how to do that.