Create and Prepare the nyc Example DataBaseΒΆ
This small section contains a step-by-step guide for the creation and population of an database containing few geospatial tables of New York City:
- giant_polygon
- poi
- poly_landmarks
- tiger_roads
Log as postgres system user
$ su - postgresCreate the role bob with password postgres
$ psql -c "CREATE ROLE bob LOGIN ENCRYPTED PASSWORD 'md565170a859842ceb2930dc2fa1454af9d' CREATEDB VALID UNTIL 'infinity';"
Create the database nyc with the geospatial extensions
$ createdb nyc $ psql -d nyc -c 'CREATE EXTENSION postgis;' $ psql -d nyc -c 'GRANT ALL ON geometry_columns TO PUBLIC;' $ psql -d nyc -c 'GRANT ALL ON spatial_ref_sys TO PUBLIC;'
Restore the tables into the database from the
dump$ psql -d nyc < /tmp/nyc.dumpTest that everything is OK by connecting to the database and listing the tables
$ psql nyc \dt