Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Open ‘PG Admin’ from the Windows desktop and, using the menu options available, create a new database and a new schema within the database to hold the OS OpenMap-Local data. It is recommended that the user not use the ‘public’ schema to hold the data itself.
In the example above, a database called ‘osopenmap’ has been created along with a schema called ‘openmap’ into which the data will be loaded. As the data to be loaded comes in shapefile format, there is an easy to use PostGIS plugin available within PostgreSQL to load shapefile data.
Select ‘plugins’ from the main menu followed by ‘PostGIS Shapefile and DBF Loader’
The next window allows the user firstly to view connection details and then to add files to the database. The first thing to do will be to test connection details. Click on the ‘view connection details’ button.
The resulting box should contain the username and password already entered along with the host name. The database being used to contain the data should already be selected. Click ‘OK’
If everything is working OK, ‘connection succeeded’ should appear in the Log Window. Click the ‘Add File’ button.
In the next box which appears, use the file tree in the ‘Places’ box on the left to navigate to the folder in which the OS OpenMap-Local data resides. A list of the files will appear in the main window. It is possible to load one or all of the files into the database. In the example below, all of the shapefiles have been selected. The click ‘Open’.
Another window will open listing the selected shapefiles. The Schema and SRID will need to be changed. The schema will need to be changed to the schema in the database into which the data is being loaded (in this case ‘openmap’). The SRID (or co-ordinate reference system) will need to be changed to 27700, which is the code for British National Grid. This will need to be done for all of the shapefiles being loaded. No other element will need to be changed. Once this has been done click ‘Import’.
At the end of the procedure, the log window at the bottom of the PostGIS import/export manager box should indicate that all of the shapefiles have loaded successfully. However one or two of the shapefiles may fail to load because the text encoding needs to be changed from UTF-8 to LATIN1. If this is the case, the user will need to close down the plugin and start again selecting just the shapefiles which failed to load previously. The schema and SRID must be changed again and this time, the character encoding will need to be changed. This can be done by clicking the ‘options’ button;
Change the DBF character encoding to LATIN1 and click ‘OK.
Changing this should allow the import to complete successfully. For information, the shapefiles which are mostly likely to need this change to be made are the ‘named place, important building and functional site’ files. This is because these files contain text which may have accents within them which are not part of the UTF-8 character set.
Once the import has been completed, the user can check if the data is loaded properly by refreshing the schema in PGAdmin and opening up the ‘table’ tree. If the data has loaded correctly, there should be 20 tables in the schema.
The data is now loaded into the PostGIS database and is now ready to be viewed in a GIS application. As QGIS, the open-source GIS, has been developed to work seamlessly with PostGIS, we will open up and view the data using that application. However, any GI application which includes support for PostGIS can be used.
PostGIS is the geospatial extension to the free open-source database application PostgreSQL. The PostGIS extension needs to be installed as part of the PostgreSQL install. Instructions of how to do this can be found on the OS Web Site;
All current commonly used versions of MapInfo Professional are able to open ESRI shapefiles without direct translation. However, for ease of use within MapInfo, it is recommended that users use the universal translator within MapInfo to convert the shapefile supply to MapInfo .TAB files prior to loading the data. This will be described in the procedures for loading the data.
In MapInfo Professional, start universal translator from the ‘Tools’ menu.
Select the translate button at the top left hand side of the dialog box.
In the next box, the user will need to select the translation parameters required. These will include the format of the files being translated, the format to which the data is being translated and the location of the data.
Once selected, click ‘OK’. The translation will then run.
A message box will appear when the process in complete. The user will now have a MapInfo .TAB file for the selected layer of OS OpenMap-Local. This procedure will have to be repeated for all of the layers within OS OpenMap-Local which are required.
To load the created MapInfo .TAB files into MapInfo Professional simply click ‘File – Open’ and navigate to where the files reside. Select the file to be opened. Select ‘new mapper’ from the drop-down menu and click ‘OK’. For successive layers (if loading one layer at a time) select ‘current mapper’ as some of the data is already loaded. A point to note is that MapInfo Professional will open the data un-styled. The screenshot below shows the TQ Buildings and roads layers loaded.
MapInfo Professional, unlike many other GI applications, is better styled at translation stage because the .TAB format used by MapInfo can retain all of the styling information applied in the translation process – it does not use separate styling files to apply a style to the data. OS OpenMap-Local at the current time is not supplied in MapInfo .TAB format. Therefore, there is no Ordnance Survey published styling information for use in MapInfo Professional at the present time. It is however possible to style the data manually in MapInfo and achieve a pleasing result.
To add a style to a layer which has been loaded, open up the layer control window and then select the style override box;
Click the button and a new region style window will appear. It will then be necessary to select a colour for both the fill and the border for the layer to be styled. When the box containing a number of basic colours appears, select the very south east box (with the …. pattern in it) and the next window pops up which will allow a specific RGB value to be entered.
Select a suitable RGB layer for the foreground and then for the border. The selected style will now appear for the layer. Repeat this procedure for all of the other layers in OS OpenMap-Local.
For the layers within OS OpenMap-Local which require different styles to be applied to different attributes within the layer, it is necessary within MapInfo to select out the different attributes using a query. Once the attribute is selected, it will be possible to style on that attribute, either within the original .TAB file or by creating a new subset .TAB file. This second option will be described here as it allows the end user to have more flexibility in terms of layer ordering and allows different subsets of OS OpenMap - Local to be loaded and used for different requirements.
The example below shows a few of the elements of the ‘roads’ layer have already been styled;
In the example following, another element of the OS OpenMap-Local ‘roads’ layer will be styled by creating a new .TAB file for the ‘Primary Roads Collapsed Dual Carriageway’ element of the TQ_Roads layer.
Firstly, from the main menu, select ‘Query’ and ‘SQL Select’.
In the window that follows enter into the relevant boxes the information required to pull out the primary roads, collapsed dual carriageway element of the roads layer;
When creating the new table be sure that the table name being assigned does not contain spaces. Click ‘OK’. MapInfo will now create a new .TAB file query for that element of the data. To save out this query as a .TAB file select from the main menu, ‘File, Save Copy As..’ and then select the name of the table.
Then click the ‘Save As’ button.
At the next window, select the location for the .TAB file and then click ‘OK’. Click ‘File, open’ at the main menu and select the newly created table.
Once selected, click ‘OK’. The new table will appear in the layer control window.
The user can now style this table with an appropriate style as required. A result of this may look like the following depending upon what style is selected.
This procedure will have to be repeated for other elements of the roads layer as required. In OS OpenMap-Local, the functional sites, roundabouts and roads layers will require this approach. All of the other layer elements can be styled on a simple individual basis.
In MapInfo it is possible to merge the elements of two .TAB files together into one new table using the ‘append’ function. This only works for data tables of the same type and will only work for two .TAB files at a time. Please note that the file into which the new data is appended will need to be saved as a new table at the end of the process. This append process will have to be repeated for all elements of the OS OpenMap-Local data if two areas are required.
If the user wishes to merge elements of more than two .TAB files together at the same time, for example, if there was a requirement to combine the elements of TQ, SU and TL together; the user would have to use another solution. A number of custom built script files have been written for MapInfo and are available on the internet. An alternative would be to use the freely available open-source GIS QGIS to merge the shapefiles together before creating the .TAB files in MapInfo. The user should be aware that these merged tables will contain duplicate features.
The example shows the result of appending the SU_Roads element of OS OpenMap-Local into the TQ_Roads table. The ‘TQ_Roads_merged’ table should be saved as a copy of the TQ_Roads table to keep the merged data.
There are several ways of doing this in MapInfo Professional. One of the ways to use SQL queries is described in the MapInfo knowledge base article which can be found here:
The guides below detail how to load raster data for the following products:
The GML data can be imported into ArcGIS using the Quick Import function in Arc Toolbox. The data will be imported un-styled. Users should also note that due to the large file sizes of some of the 100km2 grid tiles especially SU and TQ, this import may take time to process.
The quick import will create a special file geodatabase into which to import the data. Once the quick import function has been completed, the data can be added using the usual ‘add data’ button in ArcMap and selecting all of the layers from the newly created file geodatabase;
The resulting imported data will then appear in the ArcMap window and can then be styled according to user requirements.
The data can also be styled with a suitable ArcGIS layer file for OS OpenMap-Local previously created or styled manually using the styling tools provided.
OS OpenMap-Local is supplied in GML version 3.2.1. At the current time, most versions of MapInfo Professional will not import this version of GML data. Version 12.5 of MapInfo Professional does read the latest version of GML data but this has not been tested. The only alternative way of loading GML data to MapInfo would be to use third party translation software. Some of this is open-source and some is commercial.
The guides below detail how to load vector data for the following products:
It is possible to load multiple 100km² grid tiles of data into the same schema in PostgreSQL. As the shapefiles have the 100km grid letters as a prefix in the filename, these files will go into separate tables in the schema. It will then be possible to view data across tile edges using QGIS or other GI applications which support PostGIS.
The screenshot above shows data from the SU grid tile (styled) and the buildings and roads from the TQ grid tile (un-styled). However, it should be noted that duplicate features will exist across the tile edges as the data is supplied as ‘hairy tiles’ as previously indicated.
As stated above, if using multiple tiles of data in PostGIS, loading them as described, some features will replicated across tile edges loaded in different tables of the same features, e.g. in SU_Buildings and TQ_Buildings. If the data is being used for contextual purposes only, this should not be an issue for the user. However, if the data is being used for any kind of analysis involving counts of features, these duplicates will need to be removed to avoid providing spurious results.
It is possible to remove these features using SQL commands in PostgreSQL itself.
Firstly, create a merged file containing the area required using the merge shapefile feature in QGIS documented earlier. In this example, the roads from TQ and SU will be merged. Once created, these merged shapefiles can be loaded into PostgreSQL using the shapefile loader plugin as described above.
Check to see that the merged file has been loaded. This table will contain duplicate features across the tile edges. Using the SQL window in PostgreSQL, a count of the features within the file can be determined using the following command;
In the case above the command is querying the table os_openmap_su_tq_roads in the schema openmap used previously in this guide. The count returned will be as follows in this example;
Using the following command, a new table called os_openmap_su_tq_roads_dissolved will be created in the same schema osopenmap;
Finally the following command will provide a count of the features in the newly created dissolved table;
The result of this query is as follows;
The user can see, from running this query that the number of features in the newly created table is less that in the original merged table. This indicates that the duplicate features along the tile edges have been removed. It will now be possible to load the dissolved table into QGIS and carry out the required analysis.
An alternative way to do what has been described above would be to merge the required shapefiles together and de-duplicate using QGIS as described earlier in this document. The user will then have a set of de-duplicated shapefiles which can then be loaded into PostgreSQL/PostGIS and displayed in QGIS using the methods described previously.
This getting started guide provides instructions for using OS OpenMap - Local in different software applications. Users with limited technical knowledge will be able to follow this guide.
From the end of October 2016, OS OpenMap – Local will be available as both a raster version and a vector version as previously. This getting started guide illustrates how to load both raster and vector versions of the product into several GI applications.
OS OpenMap-Local raster data can be downloaded from the OS OpenData website in GeoTIFF format. This format does not require the use of geo-referencing files in the loading process. The data will be available in 100km² grid zip files, aligned to National Grid letters.
OS OpenMap-Local vector data can be downloaded from the OS OpenData website in either ESRI Shapefile format or in .GML format version 3.2.1. It is available as 100km² tiles which are aligned to the 100km national gird letters, for example, TQ. The data can also be downloaded as a national set in ESRI shapefile format only. The data will not be available for supply on hard media as in the case of some other OS OpenData products.
ESRI shapefile supply.
The data is supplied in a .zip archive containing a parent folder with two sub folders entitled DATA and DOC. All of the component shapefiles are contained within the DATA folder. The data is supplied as ‘hairy tiles’ in that no feature is broken at the tile edge, but is included across the tile boundary if it extends into an adjacent tile. A data holding comprising of more than one 100km² tile will contain duplicate features which may need to be removed depending upon the user requirement.
GML supply.
The data is supplied in a .zip archive containing a parent folder with two sub-folders entitled DATA and DOC. The data is supplied in the DATA folder as one .GML file covering the whole area. The data is supplied as ‘hairy tiles’ in that no feature is broken at the tile edge, but is included across the tile boundary if it extends into an adjacent tile. As with the shapefile supply, a data holding comprising of more than one 100km² tile will contain duplicate features which may need to be removed depending on the user's requirement.
There are currently no plans to make this product available on hard media supply.
The OS OpenMap – Local Getting Started guide is broken down into the following topics:
In QGIS, click on the ‘open PostGIS layer’ button on the left hand side of the window.
In the next window, a new connection will have to be set up to the newly created database containing the OS OpenMap-Local data. Click on ‘new’. Another window called ‘create PostGIS connection’ will appear. Information will be required to be entered into this window to set up the new connection.
In this example, the name ‘osopenmap’ for the connection has been provided along with the name of the database which holds the data. Click on the ‘Test Connect’ button to ensure that the correct connection is made. Once successful, click ‘OK’. If the save username and save password boxes have been clicked, click ‘OK’ in the subsequent message box.
A new connection will now be available in the list of PostGIS database connections. Ensuring that the correct one is listed, click on ‘connect’. The schema containing the OS OpenMap-Local data can be seen.
Click on the + sign next to the schema to expand the list of tables. Select all of the tables within OS OpenMap-Local that are required to be loaded to QGIS. Once all have been selected, click ‘Add’.
The OS OpenMap-Local data will load into QGIS. The data will need to be re-ordered and then styled appropriately using personalised style files or the style files available from GitHub published by Ordnance Survey. If using these published files, please consult the accompanying ‘Quick Start Guide’ as to their use. It should be noted that there is no requirement to add a spatial index to the data from PostGIS as those indexes were added automatically during the loading of the data into PostgreSQL.
If using the published style files, the output should appear as shown above.