Changes between Version 19 and Version 20 of GeoDjangoInstall


Ignore:
Timestamp:
09/29/07 18:09:11 (7 years ago)
Author:
jbronn
Comment:

Edited user install notes; updated to use backticks instead of code blocks where appropriate.

Legend:

Unmodified
Added
Removed
Modified
  • GeoDjangoInstall

    v19 v20  
    1414=== Python & PostgreSQL ===
    1515 * '''Python'''
    16    * ''Required:'' Python 2.4 is required because of heavy use of 2.4 decorator syntax (''e.g.'' {{{@property}}}).  The {{{ctypes}}} module needs to be installed as well.
    17    * ''Recommended:'' Python 2.5 is recommended because the {{{ctypes}}} module comes included.  [http://www.python.org/download/releases/2.5.1/ Python 2.5.1] is the current latest.
     16   * ''Required:'' Python 2.4 is required because of heavy use of 2.4 decorator syntax (''e.g.'' `@property`).  The `ctypes` module needs to be installed as well.
     17   * ''Recommended:'' Python 2.5 is recommended because the `ctypes` module comes included.  [http://www.python.org/download/releases/2.5.1/ Python 2.5.1] is the current latest.
    1818 * '''PostgreSQL'''
    1919   * ''Recommended:'' PostgreSQL 8.x.  If installing binary packages, please install the development package as well for headers required in PostGIS compilation.
    2020   * We are currently developing using both v8.1 and v8.2 of PostgreSQL.
    21    * On Ubuntu Feisty and Debian etch, install {{{postgresql-8.x}}} and {{{postgresql-server-dev-8.x}}} (the development package is required for PostGIS compilation).
    22      * On Debian etch install the {{{libpq-dev}}} package, which includes the {{{pg_config}}} executable (also required for PostGIS compilation).
     21   * On Ubuntu Feisty and Debian etch, install `postgresql-8.x` and `postgresql-server-dev-8.x` (the development package is required for PostGIS compilation).
     22     * On Debian etch install the `libpq-dev` package, which includes the `pg_config` executable (also required for PostGIS compilation).
    2323 * '''psycopg2'''
    2424   * [http://initd.org/tracker/psycopg/wiki/PsycopgTwo psycopg2] is a Python database adapter for PostgreSQL.  Latest version is [http://initd.org/pub/software/psycopg/psycopg2-2.0.6.tar.gz 2.0.6].
    2525
    2626=== Django ===
    27  * !GeoDjango exists in the {{{gis}}} branch from SVN:
     27 * !GeoDjango exists in the `gis` branch from SVN:
    2828{{{
    2929$ svn co http://code.djangoproject.com/svn/django/branches/gis django_gis
     
    3131}}}
    3232
    33  * To detect the correct site-packages to use don't forget to use:
     33 * To detect the correct `site-packages` directory, the following command may be used:
    3434{{{
    3535$ python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"
     
    3939 * We have been developing using [http://geos.refractions.net/ GEOS] 3.0.0RC4, and have not tested using GEOS 2.x.  Despite the "RC" nomenclature, 3.0.0RC4 is quite stable, and will be renamed to 3.0.0 after FOSS4G.
    4040   * ''See'' Mateusz Loskot (GEOS lead developer), [http://lists.refractions.net/pipermail/geos-devel/2007-August/002936.html Note about GEOS 3.0.0 release].
    41  * !GeoDjango has its own GEOS {{{ctypes}}} wrapper; you do ''not'' need to enable the existing GEOS Python bindings.
    42    * {{{ctypes}}} comes standard with Python 2.5.  If you run Python 2.4, {{{ctypes}}} may be [http://sourceforge.net/project/showfiles.php?group_id=71702&package_id=71318 downloaded here], but in etch you can use python-ctypes and don't forget to install swig.
    43  * Configure, make, and install.
     41 * !GeoDjango has its own GEOS `ctypes` wrapper; you do ''not'' need to enable the existing GEOS Python bindings.
     42   * `ctypes` comes standard with Python 2.5.  If you run Python 2.4, `ctypes` may be [http://sourceforge.net/project/showfiles.php?group_id=71702&package_id=71318 downloaded here], but in Debian etch you may install the `python-ctypes` package.
     43 * Configure, make, and install (`g++` is required for compilation)
    4444{{{
    45 $ apt-get install swig
    4645$ ./configure
    4746$ make
     
    4948}}}
    5049
    51  * You must have g++ already installed.
    52 
    5350=== PROJ.4 ===
    5451 * Latest [http://proj.maptools.org/ PROJ.4] version is 4.5.0.  We have no reason to believe that previous versions (''e.g.'', 4.4.x, 4.3.x) will not work.
    55  * First, download the PROJ [ftp://ftp.remotesensing.org/proj/proj-datumgrid-1.3.tar.gz datum shifting files].  These will come in handy for coordinate transformations when other programs (like Mapserver or Mapnik) are not able to cope with EPSG transformations (I learned the hard way). Untar/unzip these in the {{{nad}}} subdirectory of the PROJ source.  For example, if PROJ was unzipped in a directory named {{{proj}}}, then untar these files in {{{proj/nad}}}.  Do this '''before''' you do the configure/make/install dance.
     52 * First, download the PROJ [ftp://ftp.remotesensing.org/proj/proj-datumgrid-1.3.tar.gz datum shifting files].  These will come in handy for coordinate transformations when other programs (like Mapserver or Mapnik) are not able to cope with EPSG transformations (I learned the hard way). Untar/unzip these in the `nad` subdirectory of the PROJ source.  For example, if PROJ was unzipped in a directory named `proj`, then untar these files in `proj/nad`.  Do this '''before''' you do the configure/make/install dance.
    5653   * ''See'' [http://remotesensing.org/proj/faq.html PROJ FAQ]; ''see also'' [http://mapserver.gis.umn.edu/data2/wilma/mapserver-users/0301/msg00541.html Frank Warmerdam's reply to a Mapserver question].
    5754 * Next, configure, make and install.
     
    6562 * ''Required'':  PostGIS ~~v1.1.0~~ v1.2.1 and above.  1.1.0 support is currently pending, ''see'' #5498.
    6663 * ''Recommended'': Postgis v1.3.1 [http://postgis.refractions.net/download/ PostGIS] (this is the [http://postgis.refractions.net/news/20070809/ latest version]).
    67  * On Debian etch install the flex package. (May bee its required in other Linux)
    68 {{{
    69 apt-get install flex
    70 }}}
    7164 * First build & install PostGIS.
    7265{{{
     
    7568# make install
    7669}}}
    77 
    78  * Next, create a role and database for your application, and allow it to access PostGIS functionality.  PostGIS SQL files are installed in the PostgreSQL share directory (`/usr/postgres/8.2/share` in the example below -- use `pg_config --sharedir` to determine this directory on your system).
     70   * Note: the `flex` package maybe required for PostGIS compilation on Debian distributions and may be installed with the command: `apt-get install flex`
     71 * Next, create a role and database for your application, and allow it to access PostGIS functionality.  PostGIS SQL files are installed in the PostgreSQL share directory (`/usr/postgres/8.2/share` in the example below; use the `pg_config --sharedir` command to determine this directory on your system).
    7972{{{
    8073# su - postgres
     
    8982}}}
    9083
    91  * Now that you have installed postgis, if you get errors about not finding some libraries, make sure to edit /etc/ld.so.conf in order to add /usr/local/lib , and then run
    92 {{{
    93 $ ldconfig
    94 }}}
     84 * Note: if you experience errors about not finding libraries, you may need to adjust your `LD_LIBRARY_PATH` (which may be configured system-wide by editing `/etc/ld.so.conf` and running `ldconfig`).  On Solaris platforms use the `crle` utility to configure the runtime linking environment.
     85
    9586 * Finally, update your {{{settings.py}}} to reflect the name and user for the spatially enabled database.  So far, we only plan to support the psycopg2 backend, thus: {{{DATABASE_ENGINE='postgresql_psycopg2'}}}.
    9687
     
    9889 * ''Highly Recommended'': Some features (''e.g.'', a large number of {{{SpatialRefSys}}} model routines) require GDAL, but it is not necessary for core functionality like spatial queries. 
    9990 * GDAL/OGR includes useful for coordinate transformations and reading/writing ''both'' vector (''e.g.'', SHP) and raster (''e.g.'', GeoTIFF) geographic data.
    100    * For example, the following command will convert your SHP file into [http://en.wikipedia.org/wiki/WGS84 WGS84] (standard lat/lon).  Then you can import directly into your database using {{{shp2pgsql}}} (utility from PostGIS):
     91   * For example, the following command will convert your SHP file into [http://en.wikipedia.org/wiki/WGS84 WGS84] (standard lat/lon).  Then you can import directly into your database using `shp2pgsql` (utility from PostGIS):
    10192{{{
    10293ogr2ogr -t_srs WGS84 output.shp input.shp
     
    10899# make install
    109100}}}
    110  * As of r5397 there's a {{{ctypes}}} layer for GDAL/OGR, no additional Python bindings are needed. 
     101 * As of r5397 there's a `ctypes` layer for GDAL/OGR, no additional Python bindings are needed. 
    111102 * If you still want to use the GDAL Python API for your own applications, then the following configuration flags:
    112    * {{{--with-python}}} {{{--without-ngpython}}}: the deprecated, but stable API.
    113    * {{{--without-python}}} {{{--with-ngpython}}}: the "next-generation" SWIG-based bindings -- used to problematic for Python 2.5 users, but the GDAL team has solved a lot of these issues in 1.4.2.
     103   * `--with-python` `--without-ngpython`: the deprecated, but stable API.
     104   * `--without-python` `--with-ngpython`: the "next-generation" SWIG-based bindings -- used to problematic for Python 2.5 users, but the GDAL team has solved a lot of these issues in 1.4.2.
    114105   * ''See generally'' [http://trac.osgeo.org/gdal/wiki/GdalOgrInPython GDAL/OGR In Python] on the GDAL trac wiki.
    115106
     
    126117That said, here are some additional program recommendations that, while not required, make your Python experience in Windows less painful:
    127118
    128  * The Windows command-line terminal is  It's difficult to re-size and copy and paste from.  I (jbronn) find [http://sourceforge.net/project/showfiles.php?group_id=43764&package_id=36333 Console2] more convenient to use than one supplied with Windows ({{{cmd.exe}}}). 
     119 * The Windows command-line terminal is  It's difficult to re-size and copy and paste from.  I (jbronn) find [http://sourceforge.net/project/showfiles.php?group_id=43764&package_id=36333 Console2] more convenient to use than one supplied with Windows (`cmd.exe`). 
    129120 * [http://ipython.scipy.org/moin/FrontPage IPython] also runs on Windows, and makes life easier.
    130121   * Latest version of IPython is [http://ipython.scipy.org/dist/ipython-0.8.1.win32.exe 0.8.1].
     
    134125=== Python ===
    135126
    136 Download and run the [http://python.org/ftp/python/2.5.1/python-2.5.1.msi Python installer].  We highly recommend you use Python 2.5 or greater (2.5.1 is the latest, and the version linked to).  Python 2.5 includes the {{{ctypes}}} library, which is required for the GEOS, GDAL, and readline (if you're using IPython) interfaces.  Python 2.4 users may obtain {{{ctypes}}} from the [http://sourceforge.net/project/showfiles.php?group_id=71702 sourceforge download page].
     127Download and run the [http://python.org/ftp/python/2.5.1/python-2.5.1.msi Python installer].  We highly recommend you use Python 2.5 or greater (2.5.1 is the latest, and the version linked to).  Python 2.5 includes the `ctypes` library, which is required for the GEOS, GDAL, and readline (if you're using IPython) interfaces.  Python 2.4 users may obtain `ctypes` from the [http://sourceforge.net/project/showfiles.php?group_id=71702 sourceforge download page].
    137128
    138 In order to be able to invoke {{{python}}} from the command-line, setup your Windows {{{Path}}} environment variable to include the Python installation directory:
     129In order to be able to invoke `python` from the command-line, setup your Windows `Path` environment variable to include the Python installation directory:
    139130 1. Right-click on "My Computer" icon (either on the Desktop or through the Start Menu).
    140131 2. Select the "Advanced" tab.
    141132 3. Click the "Environment Variables"
    142  4. Under "System Variables" select {{{Path}}} and click the "Edit" button.
    143  5. Append "{{{;C:\Python25}}}" to the value therein.
     133 4. Under "System Variables" select `Path` and click the "Edit" button.
     134 5. Append "`;C:\Python25`" to the value therein.
    144135
    145136=== PostgreSQL ===
     
    147138Download and run the PostgreSQL installer from [http://www.postgresql.org/ftp/binary/v8.2.4/win32/ here].  Do '''not'''  install the PostGIS version bundled with this installer.  The latest version of PostgreSQL is 8.2.5.
    148139
    149 If you want to invoke PostgreSQL commands from the shell, append "{{{;C:\Program Files\PostgreSQL\8.2\bin}}}" to the Windows {{{Path}}}.
     140If you want to invoke PostgreSQL commands from the shell, append "`;C:\Program Files\PostgreSQL\8.2\bin`" to the Windows `Path`.
    150141
    151142=== PostGIS  ===
     
    153144PostGIS maintains a [http://postgis.refractions.net/download/windows/ distribution for Windows], and includes pre-built libraries for PROJ 4.5.0 and GEOS 3.0.0rc4 (both are the latest versions).  You may download the latest [http://postgis.refractions.net/download/windows/pg82/postgis-pg82-setup-1.3.1-1.exe PostGIS (1.3.1) here].  Run this ''after'' the PostgreSQL installer.
    154145
    155 If you added the directory to PostgreSQL to your {{{Path}}} (see above), the following command may be used to easily create spatial databases:
     146If you added the directory to PostgreSQL to your `Path` (see above), the following command may be used to easily create spatial databases:
    156147{{{
    157148C:\> createdb -T template_postgis <database name>
     
    160151=== psycopg2 ===
    161152
    162 Windows binary packages of the {{{psycopg2}}} module are packaged by Jason Erickson, and may be downloaded from his [http://www.stickpeople.com/projects/python/win-psycopg/ win-psycopg website].  The latest version maintained for Python 2.5 and PostgreSQL 8.2.4  is [http://www.stickpeople.com/projects/python/win-psycopg/psycopg2-2.0.6.win32-py2.5-pg8.2.4-release.exe pyscopg2 2.0.6].
     153Windows binary packages of the `psycopg2` module are packaged by Jason Erickson, and may be downloaded from his [http://www.stickpeople.com/projects/python/win-psycopg/ win-psycopg website].  The latest version maintained for Python 2.5 and PostgreSQL 8.2.4  is [http://www.stickpeople.com/projects/python/win-psycopg/psycopg2-2.0.6.win32-py2.5-pg8.2.4-release.exe pyscopg2 2.0.6].
    163154
    164155=== GEOS ===
    165156
    166 After PostGIS has installed, copy the GEOS ({{{libgeos-3-0-0rc4.dll}}}, {{{libgeos_c-1.dll}}}), and PROJ ({{{libproj.dll}}}) libraries from {{{C:\Program Files\PostgreSQL\8.2\bin}}} (or wherever you installed PostgreSQL) to a location accessible to the Python interpreter (''e.g.'', {{{C:\Python25\DLLs}}}, or {{{C:\Python25}}}).
     157After PostGIS has installed, copy the GEOS (`libgeos-3-0-0rc4.dll`, `libgeos_c-1.dll`), and PROJ (`libproj.dll`) libraries from `C:\Program Files\PostgreSQL\8.2\bin` (or wherever you installed PostgreSQL) to a location accessible to the Python interpreter (''e.g.'', `C:\Python25\DLLs`, or `C:\Python25`).
    167158
    168159=== GDAL/OGR ===
     
    171162
    172163
    173 A snapshot (0.9.0 Preview-2) windows installer of [http://www.qgis.org/ Quantum GIS] (QGIS) can be obtained from [http://download.qgis.org/qgis/win32/qgis_setup0.9.0.01_09_2007.exe here]. Once installed, copy all the DLLs from {{{C:\Program Files\Quantum GIS}}} to {{{C:\Python25}}}: Do not overwrite any dlls that come from PostGIS.
     164A snapshot (0.9.0 Preview-2) windows installer of [http://www.qgis.org/ Quantum GIS] (QGIS) can be obtained from [http://download.qgis.org/qgis/win32/qgis_setup0.9.0.01_09_2007.exe here]. Once installed, copy all the DLLs from `C:\Program Files\Quantum GIS` to `C:\Python25`: Do not overwrite any dlls that come from PostGIS.
    174165
    175 
    176 == Installation Test ==
     166== Third-Party Library Installation Tests ==
    177167
    178168You can run these tests in order to see if the installation was successful.
     
    183173#!python
    184174>>> from django.contrib.gis.gdal import HAS_GDAL
    185 >>> print HAS_GDAL
     175>>> print HAS_GDAL # Will be False if GDAL libraries are not found
     176True
     177>>> from django.contrib.gis.tests import test_gdal
     178>>> test_gdal.run()
    186179}}}
    187180
     
    191184>>> test_geos.run()
    192185}}}
    193 
    194 
    195 
    196 
    197 
    198 
    199 
    200 
Back to Top