Changes between Version 2 and Version 3 of GeoDjangoUbuntuInstall


Ignore:
Timestamp:
Aug 16, 2008, 2:26:48 PM (16 years ago)
Author:
springmeyer
Comment:

Cleanup up PostGIS example for GeoDjango Ubuntu Install Guide

Legend:

Unmodified
Added
Removed
Modified
  • GeoDjangoUbuntuInstall

    v2 v3  
    6767{{{
    6868sudo vim /etc/postgresql/8.2/main/pg_hba.conf
    69 #change ident sameuser to trust
     69# change ident sameuser to trust - WARNING SECURITY RISK
    7070# comment out this line to allow, for instance, to django/psycopg2 to connect without password
    7171local   all         postgres                          ident sameuser
     
    9090
    9191=== Step 6 ===
    92 Create your PostGIS database
     92Create your PostGIS `template_postgis` database
    9393{{{
    9494# Switch to the default postgres user
     
    100100# Load the required procedural language for postgis
    101101createlang plpgsql -d template_postgis -U postgres
    102 # Load optional languages
    103 # Load postgis functions and spatial reference info
    104 # which likely was installed in the postgres share directory
    105 pg_config --sharedir
    106 /usr/local/pgsql/share
    107 # Also look for lwpostgis.sql and spatial_ref_sys.sql in:
     102}}}
     103
     104Now you are ready to actually load the postgis functions and tables as sql inserts
     105 * Note: the two postgis sql files (lwpostgis.sql and spatial_ref_sys.sql) were likely installed in the postgres share directory
     106{{{
     107pg_config --sharedir # will give you that dir
     108# Also look in:
    108109ls /usr/share/ # or /usr/local/share/
     110}}}
     111Try:
     112{{{
    109113psql -d template_postgis -U postgres -f /usr/share/postgresql-8.3-postgis/lwpostgis.sql
    110114# Note: ignore any NOTICES, like 'psql:/usr/share/lwpostgis.sql:44: NOTICE:  type "histogram2d" is not yet defined'
    111 # You should see output like:
     115}}}
     116 * You should see output like:
     117{{{
    112118BEGIN
    113119CREATE FUNCTION
     
    117123CREATE AGGREGATE
    118124COMMIT
    119 # If you get an error about not being able to find  `geos` add:
    120 /usr/local/lib to /etc/ld.so.conf
    121 # And run:
     125}}}
     126 * If you get an error about not being able to find  `geos` add /usr/local/lib to /etc/ld.so.conf and run:
     127{{{
    122128ldconfig # Then restart PostgreSQL
    123 # Then load the geographic projections table
     129}}}
     130Then load the geographic projections table:
     131{{{
    124132psql -d template_postgis -U postgres -f /usr/share/postgresql-8.3-postgis/spatial_ref_sys.sql
    125133}}}
Back to Top