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?
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 :Firstline "C:\Program Files (x86)\PostgreSQL\8.4\bin\shp2pgsql" -d -D -s 27700 -i %1 public.%2 | psql -d GISdb Set first=No :end
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
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.