4
Setting up PostGIS Here is what I do on PostGIS 8.4 (granted, an older vsion) Install Postgresql and PostGIS Create cluster (just DB) Start postgres initdb -D /var/lib/postgresql/data postgres -D /var/lib/postgresql/data

Postgis setup

Embed Size (px)

Citation preview

Page 1: Postgis setup

Setting up PostGIS

• Here is what I do on PostGIS 8.4 (granted, an older vsion) !

• Install Postgresql and PostGIS !

• Create cluster (just DB) !

!!• Start postgres

initdb -D /var/lib/postgresql/data

postgres -D /var/lib/postgresql/data

Page 2: Postgis setup

Setting up PostGIS

• Create database • As “postgres" user, create postgresql tables using Imposm’s

create-db.sh script (and modified for the right db name) • (I was using Imposm 2.0)

create-db.sh

Page 3: Postgis setup

Setting up PostGIS

• Set it so I bind to the IP and port and expose it !!!!!

• Trust the connection to the database to my computer

In /var/lib/postgresql/data/postgresql.conf

In /var/lib/postgresql/data/pg_hba.conf

Page 4: Postgis setup

Importing into PostGIS

• Finally, import the data

osm2pgsql -c -G -U postgres -d osm -S /usr/share/osm2pgsql/default.style your_file.osm.pbf (or .osm)