This section provides step-by-step instructions on how to load the Geography Markup Language (GML) format of AddressBase Premium products into FME and a database.
GML is an XML dialect which can be used to model geographic features. It was designed by the Open Geospatial Consortium (OGC) as a means for people to share information regardless of the applications or technology that they use.
In the first instance, GML was used to overcome the differences between different GIS applications by providing a neutral file format as an alternative to proprietary formats. Because it is independent of applications, it can also be moved between databases or other types of application, which allows a wider application than just GIS data transfer.
Loading GML via a translator
Several organisations provide a loader which will translate AddressBase Premium from GML and insert the data into a database or a GIS. Due to the relational nature of AddressBase Premium, GML will not load straight into most GIS applications, meaning an external translator would be helpful to most users. If you would like to load AddressBase Premium in GML format into a GIS, please contact your vendor for more details.
GML data can be viewed and loaded into Safe FME. When AddressBase Premium is read into FME, the non-spatial tables within the product are automatically related to the spatial tables.
Note: The following instructions use FME version 2020.0, but should work in most versions.
Open FME Workbench.
Click the Reader button in the ribbon.
An Add Reader dialog box will appear.
Select GML (Geography Markup Language) as the Format.
Select a coordinate reference system from the Coord. System dropdown list.
It’s recommended that British National Grid (EPSG:27700) is selected as the coordinate reference system; however, you can select a different coordinate reference system if required.
Click the three dots button next to the Dataset box. This will bring up another dialog box where you can select the GML dataset to read into FME.
Click OK and OK again.
A Select Feature Types dialog box will appear in which you can select what feature types should be read into FME.
The BasicLandPropertyUnit and Street feature types also include the non-spatial table information, such as LPI and organisation.
Note - The following instructions are based on PostgreSQL version 12.3 and assume that you have set-up your database with the PostGIS spatial extension in a Windows environment.
Requirements:
A development platform for PostgreSQL (for example, pgAdmin or dBeaver)
A PostgreSQL database
PostGIS extension
GDAL extension
Access to a Command Prompt or similar
A basic understanding of database terminology
Instructions
Note - Before you start, make sure the AddressBase Premium GML is stored in a suitable location and the file is unzipped.
Open the Command Prompt by clicking the Windows Start button in the bottom left-hand side of the screen and typing cmdinto the search bar.
The Command Prompt will appear.
Change the directory of the Command Prompt App if necessary. The directory needs to point to the folder where the GML is stored. For this example, the GML to be loaded into PostgreSQL is stored in a C:\Temp folder.
In the Command Prompt, type cdfollowed by the directory of the location of the GML. Press Enter on the keyboard.
This will change the directory.
Where:
<host>, <port>, <database>, <username> and <password> can be found within the subsequent database.
<data_name.gml>is the AddressBase Premium GML file, for example, AddressBasePremium_AOI_2021-04- 12_001_gml.gml.
<CRS>is the coordinate reference system. British National Grid (27700) is recommended but you can use alternative coordinate reference systems if required.
Example:
Open your chosen development platform by going to the Windows Start button and selecting your chosen software.
In your Database Navigator, move to the database you loaded data into and expand the schema.
From using the code above, the GML files should be in your default schema (shown in bold). The data should load into two tables: basiclandpropertyunit and street. Data in non-spatial tables will automatically be matched to the spatial tables based on a unique identifier.
Once loaded, you may want to add Primary and Foreign Keys to the data. These can only be added on columns where the data values are unique. Where there are no unique data values, an index may be added which will aid searching. For the BLPU table, the UPRN provides a unique value.
Note - You can also manage your database using the PostGRES SQL Command Prompt.