Skip to content

Instantly share code, notes, and snippets.

@jelmervdl
Created February 21, 2017 10:02
Show Gist options
  • Save jelmervdl/014f7b31da1d7885ea638d5dc6970ac5 to your computer and use it in GitHub Desktop.
Save jelmervdl/014f7b31da1d7885ea638d5dc6970ac5 to your computer and use it in GitHub Desktop.
Import BAG into local postgres/postgis database
#!/bin/sh
brew install postgresql postgis
# Download the latest results from NLExtract (monthly updates)
wget "http://data.nlextract.nl/bag/postgis/bag-laatst.backup"
# Create a database and initialize postgis extension
createdb --encoding=UTF8 --template=template0 bag
echo "CREATE EXTENSION postgis;" | psql bag
# Import the downloaded results of NLExtract
pg_restore --no-owner -d bag bag-laatst.backup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment