Loading and displaying Shapefile supply
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.
Last updated
Was this helpful?