Changes between Version 1 and Version 2 of UsersWikiPostgisOnUbuntu


Ignore:
Timestamp:
Apr 13, 2009, 2:46:43 PM (15 years ago)
Author:
pierre
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • UsersWikiPostgisOnUbuntu

    v1 v2  
    5454== Using PostGIS ==
    5555
    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: =
    5757 From the shell:
    5858
     
    6666 '''REMEMBER:''' type 'exit' when you're done with these postgres commands to return to your normal user.
    6767
    68  2. Set up the postgis libs:
     68 2. '''Set up the postgis libs:'''
    6969
    7070        $ createlang plpgsql mytestdb
     
    7474        $ psql -d mytestdb -f /usr/share/postgresql-8.3-postgis/lwpostgis.sql
    7575
    76  if there were no errors (if the last line of output is COMMIT), then
     76  if there were no errors (if the last line of output is COMMIT), then
    7777
    7878        $ psql -d mytestdb -f /usr/share/postgresql-8.3-postgis/spatial_ref_sys.sql
    7979
    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/
    8181
    8282 2b. If you installed from source:
    8383
    84  '''NOTE:''' this looks old...
     84  '''NOTE:''' this looks old...
    8585
    8686        $ psql -d mytestdb -f /usr/share/postgresql/8.0/contrib/postgis-1.1.1/lwpostgis.sql
     
    8888        $ psql -d mytestdb -f /usr/share/postgresql/8.0/contrib/postgis-1.1.1/spatial_ref_sys.sql
    8989
    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".'''
    9191
    9292 '''Now import a shp file:'''
     
    9494        $ shp2pgsql -D myshape.shp mytable mytestdb | psql mytestdb
    9595
    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."
    9797
    98  To see if your shape file is there:
     98  To see if your shape file is there:
    9999
    100100        $ psql mytestdb