Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
You can use the Astun Technology Loader to convert GML 3.2.1 data to other geospatial and non- geospatial formats. This is a free, open-source loader for geographic data in GML and KML formats. It is written in Python and uses OGR 1.9. source data to output to any format supported by OGR, for example, shapefile and MapInfo TAB.
This loader was originally written to load OS MasterMap Topography Layer data in GML / GZ format, but you can use it to load other GML data. The loader was last updated in December 2021.
Installation files and guides for the loader, including configuration examples, are available from the AstunTechnology/Loader repository on GitHub.
This getting started guide provides instructions for using OS MasterMap Sites Layer in different software applications. Users with limited technical knowledge will be able to follow this guide.
This getting started guide shows you how to load the GML supply of the OS MasterMap Sites Layer into several commonly used geographical information system (GIS) applications.
OS MasterMap Sites Layer is supplied as an online download in the OS Data Hub.
You can order OS MasterMap Sites Layer data for either all of Great Britain or by 5 km² tile. In the 5 km² tiles, features are not clipped at tile edges, resulting in what is known as 'hairy' tiles.
The product is available in the following formats:
GeoPackage
Vector tiles (MBTiles)
GML (3.2.1)
All formats contain three layers: Functional Site, Access Point, and Routing Point.
The GML file naming conventions for OS MasterMap Sites Layer are:
National datasets are grouped into the seven themes within Sites Layer: air transport, education, medical care, rail transport, road transport, water transport, and utility and industrial.
File names follow this pattern: <product>_<theme>_<area>.gz, for example, osmmsites_airt_england.gz.
Tiled datasets are provided in 5 km² tiles. Each tile includes all themes present in that tile. Files names follow this pattern: <5k tile ID>.gz, for example, HP5000.gz.
These instructions are based on FME Desktop version 2021.1.
To load and display GML data in FME Desktop:
Open an existing workspace or create a new one.
In Readers, click Add Reader.
In the Add Reader dialog:
Format: Select OGC GML (Geography Markup Language).
Dataset: Click …, navigate to and select the GML file on your computer.
Coord. System: Optionally, select EPSG:27700. FME should detect the correct system automatically.
Click OK.
In the Select Feature Types dialog, select the layers (feature types) you want to load and click OK.
This dialog may take a while to load. You can watch the progress in green bar at the bottom left of the FME UI.
A set of readers (matching the feature types your selected) displays in the main work area.
Right-click a reader and click Connect Inspector.
An inspector automatically connects to the reader.
Click the green Run To This icon (triangle above the inspector) and then click Run in the Translation Parameter Values dialog.
A table and graphical preview of the GML data displays below the main work area when the Run command completes.
Repeat steps 5 and 6 for each layer (feature type).
You can use FME to convert GML data to other geospatial and non-spatial formats. The instructions below demonstrate how to convert to shapefile, but you can adapt them for different formats.
To convert GML to shapefile in FME Desktop:
Open an existing workspace or create a new one.
In Readers, click Add Reader…
In the Add Reader dialog:
Format: Select OGC GML (Geography Markup Language).
Dataset: Click …, then navigate to and select the GML file on your computer.
Coord. System: Optionally, select EPSG:27700. FME should detect the correct system automatically.
Click OK.
In the Select Feature Types dialog, select the layers (feature types) you want to load and click OK.
This dialog may take a while to load. You can watch the progress in the green bar at the bottom left of the FME UI.
A set of readers (matching the feature types you selected) displays in the main work area.
In Writers, click Add Writer…
In the Add Writer dialog:
Format: Select Esri Shapefile.
Dataset: Click …, then navigate to and select the folder in which you want to save your translated data.
Click OK.
In the Select Feature Types dialog, select the feature types (layers) you want to convert, and click OK.
This dialog may take a while to load. You can watch the progress in the green bar at the bottom left of the FME UI.
A set of writers (matching the feature types you selected) displays in the main work area to the right of their matching readers.
Connect each reader to its matching writer by dragging the grey triangle on the reader to the red triangle on the writer.
Click the green arrow in the top bar to run the workspace.
In the Translation Parameter Values dialog, check that the source and destination file locations are correct and click Run.
You can watch the conversion progress in the Translation Log below the main work area.
When the conversion is complete, both the GML files and shapefiles will be available in the file system on your computer and in the FME Navigator panel.
These instructions are based on Cadcorp SIS Desktop version 9.0 and assume you have set the default coordinate reference system to British National Grid (EPSG 27700). The instructions are also valid for the free, read-only version, Cadcorp SIS Desktop Express.
To load and display GML data in Cadcorp SIS Desktop:
Open an existing map or create a new one.
In Home, click Add Overlay.
In the Overlay Types dialog:
Files: Select File and click Next.
Navigate to and select the file on your computer and click Finish.
Your GML data now displays in both the Maps panel and map area. The data is un-styled and will look similar to the following image:
These instructions are based on QGIS version 3.22.4 and assume you have set the default coordinate reference system to British National Grid (EPSG 27700).
To load and display GML data in QGIS:
Open an existing project or create a new one.
In Layer, click Add Layer > Add Vector Layer.
In the Data Source Manager dialog:
Vector > Source > Vector Dataset(s): Click …, navigate to and select the GML file on your computer.
Click Add.
In the Select Items to Add dialog, select one or more site layers and click Add Layers.
Close Data Source Manager.
Your GML data now displays in both the Layers panel and map area. The data is un-styled and will look similar to the following image:
Layers panel:
Data is typically grouped by tile reference.
If you open both the point (AccessPoint and RoutingPoint) and polygon (FunctionalSite) layers, you may need to reorder the layers to see the data in the map area. Use drag and drop to do this.
If you are dealing with multiple tiles of 5 km² OS MasterMap Sites Layer data, consider converting your data to another format (for example, shapefile) as GML data does not always merge seamlessly.
Rendering performance of GML data in QGIS is not as good as other formats (for example, shapefiles), because GML data cannot be spatially indexed.
The sections that follow show you how to convert GML data to shapefile and how to apply a spatial index to shapefiles.
To convert GML to shapefile in QGIS:
In the Layers panel, right-click on the layer you want to convert and click Export > Save Features As....
In the Save Vector Layer as… dialog:
Format: Select ESRI Shapefile.
File name: Click …, navigate to the folder in which you want to store the shapefile, name the file, and click Save.
Click OK.
When you click OK, QGIS creates a shapefile from the exported GML file and saves it to the selected folder.
Repeat steps 1 and 2 for each layer you want to convert. For example, for the other layers of the 5km² OS MasterMap Sites Layer data.
When working with shapefiles, we recommend you apply a spatial index to the data, particularly when loading large or national sets of data. This significantly improves performance when rendering and panning the data.
To apply a spatial index to a shapefile in QGIS:
In the Layers panel, right-click on the layer you want to index and click Properties.
In the Layer Properties dialog:
Source > Geometry: Click Create Spatial Index and then click OK when the process is complete to close the success confirmation dialog.
Click OK.
These instructions are based on ArcMap version 10.8.1 and assume you have set the default coordinate reference system in ArcMap to British National Grid (EPSG 27700).
If your ArcMap is older than version 10.0, or if you do not have access to the Quick Import (Data Interoperability) extension, use the translation tools available in FME or QGIS (see previous sections for instructions) to convert the GML data to shapefiles before loading them into ArcMap.
You can import GML data into ArcMap using the Quick Import tool. The imported data will be un-styled.
Due to the large file size, some 5 km2 grid tile imports (especially within larger cities) may take time to process.
To load GML data in ArcMap:
In the top bar, click the ArcToolbox icon.
Expand Data Interoperability Tools and double-click Quick Import.
In the Quick Import dialog:
Input Dataset: Click … to open the Specify Data Source dialog:
Format: Select GML SF-0 (Geography Markup Language Simple Features Level SF-0 Profile).
Dataset: Click …, then navigate to and select the GML file on your computer.
Click OK.
Output Staging Geodatabase: Click the folder icon, navigate to and select the output folder on your computer.
Click OK.
The Quick Import tool creates a new geodatabase and imports the data into it.
To display the GML data in ArcMap:
Click Add Data in the tool bar.
In the Add Data dialog, select the file geodatabase (created in the previous procedure) on your computer and click Add.
Your GML data now displays in the Layers panel and map area. The data is un-styled and will look similar to the following example:
As an alternative to using ArcMap’s Quick Import tool (previous section), you can convert your GML data to shapefile using QGIS or FME, and then add it directly to ArcMap. There are instructions on how to do this in previous sections of this guide.
To load and display shapefiles in ArcMap:
Open an existing project or create a new one.
In the top bar, click Add Data.
In the Add Data dialog, select the shapefile you want to load, and click Add.
If the required folder does not display in the tree, click the Connect To Folder icon and navigate to the folder from there.
Repeat steps 2 and 3 to load the additional shapefiles (AccessPoint and RoutingPoint) that make up each 5 km2 tile of OS MasterMap Sites Layer.
Your data now displays in the Layers panel and map area. The data is un-styled and will look similar to the following example:
These instructions are based on MapInfo Professional version 16.0 and assume you have set the default coordinate reference system to British National Grid (EPSG 27700).
While MapInfo Professional can open GML 3.2.1 files without prior translation, for performance and compatibility reasons, we recommended you use the universal translator in MapInfo to convert the GML supply to MapInfo .TAB files prior to loading the data.
The sub-sections below provide alternative instructions for working with GML data in MapInfo Professional.
To load and display the GML supply directly into MapInfo Professional:
Open an existing project or create a new one.
In Home, click Open > Universal Data.
In the Specify Data Source dialog:
Format: Select GML (Geography Markup Language).
Dataset: Click …, navigate to and select the GML file on your computer.
Click OK.
In the Select Layers dialog, select the layers you want to load, and click OK.
Your GML data now displays in the Maps panel and map area. The data is un-styled and will look similar to the following example:
To convert the GML supply to MapInfo TAB in MapInfo Professional:
Open an existing project or create a new one.
In Table click Universal Translator.
In the FME Quick Translator dialog click Translate.
In the Set Translation Parameters dialog:
Reader:
Format: Select GML (Geography Markup Language).
Dataset: Click …, navigate to and select the GML file on your computer.
Writer:
Format: Select MapInfo TAB (MAPINFO).
Dataset: Click …, navigate to and select the folder in which to store your TAB files.
Click OK.
When the conversion is complete (about 30 seconds), close the FME Quick Translator dialog.
To load the converted MapInfo TAB files in MapInfo Professional:
In Home click Open > Table.
In the browser dialog, select MapInfo (*.tab) as the file type, navigate to the folder in which you stored the converted MapInfo TAB files, select the layers you want to open, and click Open.
Your data now displays in the Maps panel and map area. The data is un-styled and will look similar to the following example:
Guidance on how to use this product in GeoPackage and vector tiles formats can be found in the following documents: