Code

Changes between Version 27 and Version 28 of GeoDjangoInstall


Ignore:
Timestamp:
12/27/07 14:56:44 (7 years ago)
Author:
jbronn
Comment:

Updated installation instructions for PostGIS 1.3.2 and GDAL for 1.5.0. Documented required and recommended versions for GDAL , PROJ, and GEOS.

Legend:

Unmodified
Added
Removed
Modified
  • GeoDjangoInstall

    v27 v28  
    1818=== Python & PostgreSQL === 
    1919 * '''Python''' 
    20    * ''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. 
     20   * ''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. 
    2121   * ''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. 
    2222 * '''PostgreSQL''' 
     
    4141 
    4242=== GEOS === 
    43 !GeoDjango uses the [http://geos.refractions.net/downloads/geos-3.0.0.tar.bz2 3.0.0] version of [http://geos.refractions.net/ GEOS], and is not compatible with the 2.x versions.  With the release of 3.0.0, support for the release candidate versions will be eventually deprecated due to differences in the way geometries are serialized to WKT and HEX, as well as compilation issues for OSX 10.5.  However, the RC4 libraries are still supported for the moment, though we urge users to migrate to the 3.0.0 release. 
     43 * ''Required'': GEOS v3.0.0RC4 and above (''not'' compatible with the 2.x versions). 
     44 * ''Recommended'': GEOS [http://geos.refractions.net/downloads/geos-3.0.0.tar.bz2 3.0.0] (support for the release candidate versions will be eventually deprecated due to differences in the way geometries are serialized to WKT and HEX, as well as compilation issues for OSX 10.5 -- we urge users to migrate to 3.0.0). 
     45 
     46[http://geos.refractions.net GEOS] is an open source C++ library for performing geometric operations, and powers !GeoDjango's "lazy" geometries. 
    4447 
    4548!GeoDjango has its own GEOS `ctypes` wrapper; you do ''not'' need to enable the existing GEOS Python bindings. The `ctypes` library 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], and in Debian etch you may install the `python-ctypes` package. 
     
    6265 
    6366=== PROJ.4 === 
    64 The latest [http://proj.maptools.org/ PROJ.4] version is [ftp://ftp.remotesensing.org/proj/proj-4.6.0.tar.gz 4.6.0].  !GeoDjango also works with version 4.5.0, but there is no reason to believe that previous versions (''e.g.'', 4.4.x, 4.3.x) will not work. 
     67 * ''Required'': 4.5.0  -- this is not a strict requirement, !GeoDjango has been tested with 4.5.0, but there is no reason to believe that previous versions (e.g., 4.4.x, 4.3.x) will not work. 
     68 * ''Recommended'': [ftp://ftp.remotesensing.org/proj/proj-4.6.0.tar.gz 4.6.0] (the current latest). 
     69 
     70[http://www.remotesensing.org/proj/ PROJ.4] is a library for converting geospatial data to different coordinate reference systems. 
    6571 
    6672First, download PROJ.4 from the remotesensing website, and untar the source archive: 
     
    8894=== PostGIS === 
    8995 * ''Required'':  PostGIS ~~v1.1.0~~ v1.2.1 and above.  1.1.0 support is currently pending, ''see'' #5498. 
    90  * ''Recommended'': Postgis v1.3.1 [http://postgis.refractions.net/download/ PostGIS] (this is the [http://postgis.refractions.net/news/20070809/ latest version]). 
    91  * First build & install PostGIS.  
     96 * ''Recommended'': [http://postgis.refractions.net PostGIS] [http://postgis.refractions.net/download/postgis-1.3.2.tar.gz v1.3.2] (this is the current [http://postgis.refractions.net/news/20071201/ latest version]). 
     97 
     98First, download PostGIS, and untar the archive: 
     99{{{ 
     100$ wget http://postgis.refractions.net/download/postgis-1.3.2.tar.gz 
     101$ tar xzf postgis-1.3.2.tar.gz 
     102$ cd postgis-1.3.2 
     103}}} 
     104 
     105Run the `configure` script enabling GEOS and PROJ support, `make`, and install.  
    92106{{{ 
    93107$ ./configure --with-geos --with-proj 
     
    96110}}} 
    97111   * Note: the `flex` package maybe required for PostGIS compilation on Debian distributions and may be installed with the command: `apt-get install flex` 
    98  * 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). 
     112 
     113Next, 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). 
    99114{{{ 
    100115# su - postgres 
     
    111126 * 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`)(Hint: Most of the times the libraries you are looking for are in '/usr/local/lib').  Sometimes the errors are too many and not descriptive (i.e. operation aborted), in that cases use the '-s' switch on psql to debug step by step. On Solaris platforms use the `crle` utility to configure the runtime linking environment. 
    112127 
    113  * 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'}}}. 
     128Finally, update your `settings.py` to reflect the name and user for the spatially enabled database (thus far, we only plan to support the `psycopg2` backend for PostgreSQL): 
     129{{{ 
     130DATABASE_ENGINE='postgresql_psycopg2' 
     131DATABASE_NAME='<db_name>' 
     132DATABASE_USER='<user>' 
     133}}} 
    114134 
    115135=== GDAL === 
    116  * ''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.   
    117  * GDAL/OGR includes useful for coordinate transformations and reading/writing ''both'' vector (''e.g.'', SHP) and raster (''e.g.'', GeoTIFF) geographic data. 
    118    * 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): 
    119 {{{ 
    120 ogr2ogr -t_srs WGS84 output.shp input.shp 
    121 }}} 
    122  * Latest [http://trac.osgeo.org/gdal/wiki/DownloadSource GDAL] version is 1.4.2.  Configure with GEOS then make (use {{{gmake}}} on Solaris platforms) and install: 
     136 * ''Required'': GDAL versions 1.4.0 and above (!GeoDjango has not been tested with the 1.3.x series). 
     137 * ''Recommended'': GDAL version 1.5.0. 
     138 
     139GDAL/OGR is an excellent open source geospatial library that support features such as coordinate transformations and reading/writing ''both'' vector (e.g., SHP) and raster (e.g., GeoTIFF) geographic data -- however, !GeoDjango does not yet support GDAL's raster capabilities.  Installation of GDAL is ''highly recommended'' because some features (e.g., a large number of `SpatialRefSys` model routines and the `LayerMapping` utility) require GDAL capabilities; however GDAL is not required for core functionality like spatial queries. 
     140   
     141First, download the latest [http://trac.osgeo.org/gdal/wiki/DownloadSource GDAL] version (currently [http://download.osgeo.org/gdal/gdal-1.5.0.tar.gz 1.5.0]), and untar the archive: 
     142{{{ 
     143$ wget http://download.osgeo.org/gdal/gdal-1.5.0.tar.gz 
     144$ tar xzf gdal-1.5.0.tar.gz 
     145$ cd gdal-1.5.0 
     146}}} 
     147 
     148Configure with GEOS support, run `make` (use `gmake` on Solaris platforms) and install: 
    123149{{{ 
    124150$ ./configure --with-geos 
     
    126152# make install 
    127153}}} 
    128  * '''Note:''' The path to the GDAL library may be manually specified by setting `GDAL_LIBRARY_PATH` in your settings with the full path to the GDAL library (e.g., the `.so` or `.dylib` file). 
    129  * !GeoDjango uses a native `ctypes` API to access OGR and OSR capabilities, there is no need configure the GDAL Python bindings.  If you still want to use the GDAL Python API for your own applications, then use the following configuration flags: 
    130    * `--with-python` `--without-ngpython`: the deprecated, but stable API. 
    131    * `--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. 
     154 
     155'''Note:''' The path to the GDAL library may be manually specified by setting `GDAL_LIBRARY_PATH` in your settings with the full path to the GDAL library (e.g., the `.so` or `.dylib` file). 
     156 
     157Because !GeoDjango uses a native `ctypes` API to access OGR and OSR capabilities, there is no need configure the GDAL Python bindings.  If you still want to use the GDAL Python API for your own applications, then use the following configuration flags: 
     158   * `--with-python`: Enables the GDAL Python bindings (all GDAL modules in `osgeo` namespace) 
     159   * `--with-ogpython`: The "old-generation" bindings (separate modules, e.g., `ogr` and `osr`) 
    132160   * ''See generally'' [http://trac.osgeo.org/gdal/wiki/GdalOgrInPython GDAL/OGR In Python] on the GDAL trac wiki. 
    133161 
     
    140168=== Introduction === 
    141169 
    142 These instructions will cover using binary packages to install !GeoDjango on Windows 2000/XP platforms.  Compiling prerequisite packages (''e.g.'', GEOS) from source on Windows is beyond the scope of this documentation, as it assumes the use of community-built binary installers. 
     170These instructions will cover using binary packages to install !GeoDjango on Windows 2000/XP platforms.  Compiling prerequisite packages (e.g., GEOS) from source on Windows is beyond the scope of this documentation, as it assumes the use of community-built binary installers. 
    143171 
    144172That said, here are some additional program recommendations that, while not required, make your Python experience in Windows less painful: 
     
    182210=== GEOS === 
    183211 
    184 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`). 
     212After 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`). 
    185213 
    186214'''Note:''' The path to the GEOS library may be manually specified by setting `GEOS_LIBRARY_PATH` in your settings with the full path of the DLL.