0

I have ordnance survey master map a coverage for the whole of the UK. These are currently received on a disk every 3 months and arrive in .gz format.

Does anyone have any recommendations on how to import this into a PostgreSQL database in bulk so that multiple users can access this?

3
  • 1
    I'm afraid I can't comment but wasn't there talk of the OS delivering MasterMap as a PG dump file themselves a little while ago? I'm sure it was in one of their feedback documents that they do every now and then. Also for the OP - Astun Loader is the way to go - great tool and does what it says on the tin. Commented Mar 23, 2020 at 11:01
  • @Ramotswa that seems to make sense! Thanks for the response. Commented Mar 23, 2020 at 15:27
  • are you happy to use python to do this? Commented Nov 21, 2022 at 14:16

1 Answer 1

3

This is a fine thing to do, the easiest way to do it is with Astun's Loader, which is a free open source tool that is set up to take OS Master Map and feed it into PostGIS. It's so good that it is what OS use to load Master Map into PostGis.

A GML and KML loader written in Python that makes use of OGR 1.9. Source data can be in GML or KML format (including compressed files in GZ or ZIP format) and can be output to any of the formats supported by OGR. The source data can be prepared using a simple Python to both make it suitable for loading with OGR (useful with complex feature types) or to add value by deriving attributes.

The loader was originally written to load Ordnance Survey OS MasterMap Topographic Layer data in GML/GZ format but has since been used to load other GML and KML data.

Disclaimer I work for Astun but not on the loader team.

8
  • Hi Ian, I've actually just been trying to get my head around your Astun's loader but with not much joy so far! I'll keep you updated. Commented Mar 18, 2020 at 14:07
  • The OS use the Astun loader to import OSMM into Postgres? Given that they already hold it in a spatial format, this seems a bit inefficient. The other option would be to approach a company that wrote their own internal loader and could either supply you with pg_dump files or even host it for you in the cloud. I couldn't possibly suggest any company that would offer such services without resorting to shameless self-promotion :-) Commented Mar 18, 2020 at 16:17
  • No, I never understood it either but I suspect the assumption they hold it in a regular spatial format may be the miss-assumption we are making. I think they have a routine to export from the internal format to GML and nothing else, :-) Commented Mar 18, 2020 at 16:47
  • @ChrisJenner - feel free to ask more questions if you get stuck with loader Commented Mar 18, 2020 at 16:48
  • 1
    did you copy the symbols folder to the correct place? Commented Mar 19, 2020 at 8:26

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.