Us lucky fellows in the UK have been able to access public geodata from Ordance Survey under an open licence since April this year. Some of the datasets, including VectorMap, are broken into 100 files per grid square, each containing multiple layers, in this case in shape format. To cover the wider London area with VM you need to load 400 x 12 or so layers, with each layer identically named. Any tips on the best ways to do this, preferably using free or open source tools?


  • What do you want to load it into? (and it's up to 100, not 99) Aug 5, 2010 at 11:31
  • Corrected. To load into Postgres/ Postgis (or could be SQL Server 08) for use with MapInfo 10.5, Manifold 8, QGIS, GeoServer.
    – euki
    Aug 9, 2010 at 16:20

5 Answers 5


As a first step, if you want to merge multiple shapefiles into a single shapefile (to ease loading in whatever viewer you choose), you can use OGR utilities to merge shapefiles within a directory or multiple directories. If you're interested in experimenting with GeoScript, you can also do the same thing in JavaScript (or Python, Groovy, or Scala).


Actualy it's quite easy can be done with batch files and ogr2ogr or shp2pgsql

I have created some batch files that will loop and using ogr2ogr or shp2pgsql convert and merge the files.

Below are the shp2pgsql examples, this is just part of batch file 1, the section reports for the diferent feature types and in total took about 12 hours to run.

Batch file 1

Set LayerName=Road_Line
Set First=Yes
for /f "tokens=* delims= " %%i in ('dir %LayerName%.shp /b/s/A-d') do (
  CALL C:\Batch2 %%~fi %LayerName%

Batch file 2

IF "%first%"=="Yes" Goto Firstline
  "C:\Program Files (x86)\PostgreSQL\8.4\bin\shp2pgsql" -a -D -s 27700 -i %1 public.%2 | "C:\Program Files (x86)\PostgreSQL\8.4\bin\psql" -d GISdb 
goto end

 "C:\Program Files (x86)\PostgreSQL\8.4\bin\shp2pgsql" -d -D -s 27700 -i %1  public.%2 |  psql -d GISdb  
  Set first=No



You should look at FME Desktop from Safe Software at www.safe.com For details on the OS Vector Map reader from Safe Software, check this link: http://docs.safe.com/fme/html/FME_ReadersWriters/new_osvectormaplocal.htm


A suggestion:


With Quantum GIS (QGIS) you can load the vectormap data straight in as a ESRI Shapefiles and as 'Julien' suggests, then use the SHP to POSTGIS 'Import Shapefiles to PostGRES' tool. (the elephant icon). Tip after: Vacuum and rebuild spatial index for fast loading

If you have access to ArcGIS, ArcCatalogue can search folders for all the same file names. Then simply select all and import to a File Geodatabase using Append. Tip: Load one OS Vectormap tile to create a template for the fieldnames and fieldlengths. File Geodatabase can accommodate 1TB of data per Feature Dataset.

  • @JasonBirch noted editing all previous posts
    – Mapperz
    Aug 7, 2010 at 0:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.