In the UK we are very fortunate to have the Ordnance Survey who provide the whole of Britain in vector format. The data is provided as over 60 tiles, each of which contains something like 16 shapefiles for each feature type. Each shapefile is prefixed with the tile ID.

There are very good Q&As here already that deal with the general case for importing all this lovely data into PostGIS. For example:

find . -name *.shp -exec ogr2ogr -f PostgreSQL PG:'dbname=my-gis-database 
  active_schema=public host=localhost user=postgres password=my-password' '{}' -s_srs 
  EPSG:27700 -a_srs EPSG:27700 -overwrite -skipfailures -progress \;

Is it possible to import all of the data in one simple script like this so that:

  • Each tile inherits from a parent table e.g. HP_rivers INHERITS (rivers)?
  • The tablespace is provided to ensure it all loads onto a disk big enough to take it all in one go rather than my small but speedy SSD?

My goal is to have a single table structure which allows me to interrogate the whole of Britain or from a given tile, and to store the whole structure on a tablespace on slower but bigger disk.

1 Answer 1


Having done this with Vector Map District from MySociety http://parlvid.mysociety.org:81/os/ as in Lat/Lng WGS84, in shapefile format and no login/email required.

Simply downloaded the entire dataset and used ArcGIS (can be also done in QGIS) merged the files together - one big shapefile with attributes including the original tile name (important later). Loaded these shapefiles into PostGIS 2.0 with PgAdmin III and the bulk shapefile loader

see: Bulk load multiple shapefiles into PostGIS

enter image description here

Then the data is in a seamless database and the queries can still pull out by tile as have maintained the attributes with tile number. The reason for merging the data together is for routing which postgres/postgis and pgrouting is very efficient routable network for Great Britain.

TimeStamp your data makes updating much easier at a later date.


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.