3

I have 91 .gz files procured from the Ordnance Survey and would like to import them all to ArcGIS as shapefiles. I know that the Quick Import tool in the Data Interoperabilty extension performs the process correctly for each file (using these steps), but it would be too tedious to do that for the 91 gz files into 91 file geodatabases.

How can I automate this process so that the files are converted and each subsequent feature class is merged into the resultant layers in one file geodatabase?

I'm in my early days of python scripting.

Inside the .gz files, there are GML files. So the question is how to batch convert these GML files to a single feature class (e.g. inside FGDB) or shapefile.

  • Consider model builder to automate all this. You could use it to create 91 geodatabase then simply merge them all into a single feature class. Exactly what model builder was designed for, especially if you are not comfortable in using python. – Hornbydd Oct 7 '15 at 13:29
  • @Hornbydd, ModelBuilder can extract contents of .gz files? – artwork21 Oct 7 '15 at 13:51
  • I have used the ESRI (UK) Productivity Suite converts mastermap from .gml (including .gz) to geodatabase featureclasses why because the size for shapefile is limited to 2GB (.dbf) it also supports change only for updates in the future. esriuk.com/support/desktop/productivitysuite-downloads – Mapperz Oct 7 '15 at 13:56
  • @Hornbydd is there a way to create 91 geodatabases using the iterate files tool? – MFBawls Oct 7 '15 at 14:14
  • @MFBawls, what is inside those gz files? gml? – Farid Cheraghi Oct 7 '15 at 16:03
1

You could use python to extract the shps of each .gz file and use feature class to feature class method to import them into the destination geodatabase. The Q/A below is one example how to extract contents of many .gz files in a directory.

python script to copy and extract .gz files

  • Thanks for your answer, as I said I'm very much a beginner with Python and so ideally looking for a solution which can be used natively in ArcDesktop – MFBawls Oct 7 '15 at 12:53
1

To use GML datasets in ArcGIS you must install the ArcGIS Data Interoperability extension for Desktop. Any place where you can specify a data source, you can use a GML dataset, such as adding data to ArcMap or as an input feature with a geoprocessing tool.

So the solution:

  1. Extract all of your *.gz file into a directory (e.g. using winrar)
  2. make sure "ArcGIS Data Interoperability extension" is installed on your system
  3. Use "Merge" tool to add all of your GML file as input of that tool at once
  4. set the output parameter to a feature class inside a File Geodatabase (assuming you have already created the FGDB). If you want to output to shapefile, then set a Directory as the output parameter!

The whole process takes about 3-4 minutes. No python coding (point and click :))

  • 1
    Unfortunate OS Mastermap is not as simple as that, especially if you are working with ITN (RRI) Relationships with MasterMap see page 22 (Chapter 4) of ordnancesurvey.co.uk/docs/technical-specifications/… – Mapperz Oct 7 '15 at 16:47
  • 1
    @Mapperz The OP doesn't ask for maintaining the data model. He doesn't ask for creating the topology too. So technically, he/she wants to get from GML to FCs. – Farid Cheraghi Oct 7 '15 at 16:55

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.