Changes between Version 109 and Version 110 of WKTRaster/Documentation01


Ignore:
Timestamp:
Apr 20, 2011, 10:39:22 AM (13 years ago)
Author:
jorgearevalo
Comment:

Compile and install instructions updated.

Legend:

Unmodified
Added
Removed
Modified
  • WKTRaster/Documentation01

    v109 v110  
    132132
    133133
    134 Windows and Linux binaries are available in the [wiki:WKTRaster PostGIS Raster Home Page].
     134Windows and Linux binaries are available in the [wiki:WKTRaster PostGIS Raster Home Page]. A Windows how-to can be found [http://gis4free.wordpress.com/2011/03/10/how-to-install-and-configure-postgis-raster-on-windows/ here]
    135135
    136136== '''2.3 - Compiling and Installing from Sources''' ==
     
    138138
    139139'''2.3.1 - Compiling on Linux'''[[BR]][[BR]]
    140  1. Follow the [http://postgis.refractions.net/documentation/manual-1.3/ch02.html instructions to compile PostGIS].
    141 
    142  2. Get the PostGIS Raster source code. You have two options:
    143 
    144   * Download the latest development snapshot from http://postgis.refractions.net/download/
    145 
    146   * Using a SVN client, retrieve the very last PostGIS Raster source from http://svn.osgeo.org/postgis/spike/wktraster. In this case you will have to generate the "configure" script with autogen:
    147 
    148 {{{
    149 >./autogen.sh
    150 }}}
    151 
    152  3. From the wktraster directory, run:
    153 
    154 {{{
    155 >./configure --with-postgis-sources=/thesrc/postgis-version
    156 }}}
    157 
    158  
    159  4. Run the compile and install commands:
    160 
    161 
    162 {{{
    163 >make & make install
    164 }}}
    165 
    166 
    167  PostgreSQL provides a utility called pg_config to enable extensions like PostGIS to locate the PostgreSQL installation directory. If ./configure didn't find pg_config, try using the --with-pgconfig=/path/to/pg_config switch to specify a particular PostgreSQL installation.
    168 
    169 
    170 '''2.3.2 - Compiling on Windows using MSYS/MinGW'''
    171 
    172  1. Compile PostGIS [wiki:UsersWikiWinCompile using these instructions].
    173 
    174  2. Get GDAL 1.7.1 sources from [http://trac.osgeo.org/gdal/wiki/DownloadSource] and extract (you need this for advanced features like ST_DumpAsPolygons).
    175 
    176  3. Configure the GDAL build without libtool. (Refer to [http://trac.osgeo.org/gdal/ticket/3465].)
    177    
    178 {{{
    179 >cd /c/projects/GDAL/gdal-1.7.1
    180 >./configure --without-libtool --with-libtiff=internal --with-libz=/c/gtk/include
    181 }}}
    182  
    183  4. Edit /c/thesrc/gdal/gdal-1.7.1/GNUMakefile so that GDAL_OBJ, at the beginning of the file, is assigned like this:
    184 
    185 {{{
    186  GDAL_OBJ = ./frmts/o/*.o \
    187             ./gcore/*.o \
    188             ./port/*.o \
    189             ./alg/*.o
    190 }}}
    191 
    192  5. Build and install GDAL.
    193 
    194 {{{
    195 >make clean && make
    196 >make install
    197 }}}
    198 
    199  libgdal.dll should now exist in /usr/local/lib
    200 
    201  6. You can remove the debug information from libgdal.dll:
    202 
    203 {{{
    204 >strip /usr/local/lib/libgdal.dll
    205 }}}
    206 
    207 
    208  7. Get the PostGIS Raster source code. You have two options:
    209 
    210   * Download the latest development snapshot from http://postgis.refractions.net/download/
    211 
    212   * Using a SVN client, retrieve the very last PostGIS Raster source from http://svn.osgeo.org/postgis/spike/wktraster. In this case you will have to generate the "configure" script with autogen:
    213 
    214 {{{
    215 >./autogen.sh
    216 }}}
    217 
    218  8. CD to the wktraster folder and configure (if you don't want to build with GDAL leave out the --enable-development line).
    219 
    220 {{{
    221 >cd /c/thesrc/wktraster-svn
    222 >./configure \
    223       --prefix=/c/postgres --with-postgis-sources=/c/thesrc/postgis-version --with-pgconfig=/c/postgres/bin/pg_config
    224 }}}
    225 
    226  9. Run the compile and install commands:
    227 
    228 {{{
    229 >make & make install
    230 }}}
    231 
    232  '''Troubleshouting'''
    233 
    234  * If make tries to compile using "cc" and can't find it (you get "cc: Command not found"). Try copying gcc to cc in MinGW/bin.
    235  * If you get an error like this: ''ERROR: could not load library "c:/postgres/lib/rtpostgis.dll": The specified module could not be found'', simply add the /c/postgres/lib directory to PATH enviroment variable: export PATH=/c/postgres/lib/:$PATH
    236 
    237 '''2.3.3 - Compiling on Windows using Visual Studio'''
    238 
     140
     141As [http://gis4free.wordpress.com/2010/10/01/wkt-raster-is-now-postgis-raster/ PostGIS Raster is official part of PostGIS], you only need to compile PostGIS using special flag '--with-raster' in configure time. So, you'll first have to get the last PostGIS development snapshot from [http://postgis.refractions.net/download/postgis-2.0.0SVN.tar.gz here]. Or using a SVN client, checkout from [http://svn.osgeo.org/postgis/trunk here]
     142
     143Example with console SVN client:
     144
     145{{{
     146>. svn checkout http://svn.osgeo.org/postgis/trunk postgis-svn
     147}}}
     148
     149Now, in case you checked out the code with a SVN client, you'll need to generate the configure script with:
     150
     151{{{
     152>/autogen.sh
     153}}}
     154
     155In case you got the last development snapshot, the configure script is packed with the code. The next steps are:
     156
     157{{{
     158>./configure --with-raster
     159> make
     160> sudo make install
     161}}}
     162
     163Now, you have PostGIS 2.0 with PostGIS Raster extension installed in your system.
     164
     165
     166PostgreSQL provides a utility called pg_config to enable extensions like PostGIS to locate the PostgreSQL installation directory. If ./configure didn't find pg_config, try using the --with-pgconfig=/path/to/pg_config switch to specify a particular PostgreSQL installation.
     167
     168
     169'''2.3.2 - Compiling on Windows'''
     170
     171Instructions are [wiki:UsersWikiWinCompile here]. Simply add '--with-raster' when invoking configure scripts.
    239172
    240173
    241174'''2.3.4 - Final Installation'''
    242175
    243  1. Load the PostGIS Raster object and function definitions into your database by loading the rtpostgis.sql definitions file.
    244 
    245 {{{
    246 >psql -d [yourdatabase] -f rtpostgis.sql
    247 }}}
    248 
    249  You can also do this directly in a pgAdmin III query dialog box if you administer your database using this software.
    250  
    251  The PostGIS Raster extension should now be loaded and ready to use.
    252 
    253  All files are installed using information provided by pg_config:
     176To create a new database and activate it with PostGIS and PostGIS Raster extensions, execute these steps from a console:
     177
     178{{{
     179> createdb <your_database>
     180}}}
     181
     182{{{
     183> createlang plpgsql <your_database>
     184}}}
     185
     186{{{
     187> psql -U <your_user> -f postgis/postgis.sql -d <your_database>
     188}}}
     189
     190{{{
     191> psql -U <your user> -f spatial_ref_sys.sql -d <your_database>
     192}}}
     193
     194{{{
     195> psql -U <your user> -f raster/rt_pg/rtpostgis.sql -d <your_database>
     196}}}
     197
     198You can also do this directly in a pgAdmin III query dialog box if you administer your database using this software.
     199
     200The PostGIS Raster extension should now be loaded and ready to use. All files are installed using information provided by pg_config:
    254201
    255202   * Core functionality (rtpostgis shared library) is installed in [pkglibdir]/lib/
     
    257204   * SQL function file (rtpostgis.sql) is installed in [prefix]/share/contrib/
    258205
    259    * Loader (gdal2wktraster.py) is installed in [bindir]/
     206   * Loader (raster2pgsql.py) is installed in [bindir]/
     207
     208
     209Further information [http://gis4free.wordpress.com/2010/10/01/wkt-raster-is-now-postgis-raster/ here].
    260210
    261211