Changes between Version 1 and Version 2 of UsersWikiPostgisOnUbuntu
- Timestamp:
- 04/13/09 14:46:43 (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
UsersWikiPostgisOnUbuntu
v1 v2 54 54 == Using PostGIS == 55 55 56 1. Create a database.You must be the '''postgres''' superuser to do this: =56 1. '''Create a database.''' You must be the '''postgres''' superuser to do this: = 57 57 From the shell: 58 58 … … 66 66 '''REMEMBER:''' type 'exit' when you're done with these postgres commands to return to your normal user. 67 67 68 2. Set up the postgis libs:68 2. '''Set up the postgis libs:''' 69 69 70 70 $ createlang plpgsql mytestdb … … 74 74 $ psql -d mytestdb -f /usr/share/postgresql-8.3-postgis/lwpostgis.sql 75 75 76 if there were no errors (if the last line of output is COMMIT), then76 if there were no errors (if the last line of output is COMMIT), then 77 77 78 78 $ psql -d mytestdb -f /usr/share/postgresql-8.3-postgis/spatial_ref_sys.sql 79 79 80 '''NOTE:''' Fedora 7 installed from package path is /usr/share/pgsql/contrib/80 '''NOTE:''' Fedora 7 installed from package path is /usr/share/pgsql/contrib/ 81 81 82 82 2b. If you installed from source: 83 83 84 '''NOTE:''' this looks old...84 '''NOTE:''' this looks old... 85 85 86 86 $ psql -d mytestdb -f /usr/share/postgresql/8.0/contrib/postgis-1.1.1/lwpostgis.sql … … 88 88 $ psql -d mytestdb -f /usr/share/postgresql/8.0/contrib/postgis-1.1.1/spatial_ref_sys.sql 89 89 90 3. Make sure that your DB user has GRANT ALL on the "geometry_columns" table and GRANT SELECT on "spatial_ref_sys". =90 3. '''Make sure that your DB user has GRANT ALL on the "geometry_columns" table and GRANT SELECT on "spatial_ref_sys".''' 91 91 92 92 '''Now import a shp file:''' … … 94 94 $ shp2pgsql -D myshape.shp mytable mytestdb | psql mytestdb 95 95 96 This will take the input file "myshape.shp" and create a new table, "mytable" in the database "mytestdb."96 This will take the input file "myshape.shp" and create a new table, "mytable" in the database "mytestdb." 97 97 98 To see if your shape file is there:98 To see if your shape file is there: 99 99 100 100 $ psql mytestdb