Main Page/Stuff/Ubuntu stuff/server 9.10

From phurvitz
Jump to: navigation, search

This was mainly to try the wkt raster functionality in PostGIS. It is not promising as of 2010.03.26 for any meaningful work.

  1. install the server on a vm
  2. sudo apt-get update
  3. sudo apt-get install xinit
  4. sudo apt-get install kubuntu-desktop
  5. restart
  6. sudo apg-get install g++
  7. download and install python from source (2.6.5)
  8. sudo apt-get install libtool
  9. geos 3.2.0
    1. sudo ./configure
    2. sudo make
    3. sudo make install
  10. proj4 4.7.0
    1. sudo ./configure
    2. sudo make
    3. sudo make install
  11. sudo apt-get install libreadline-dev
  12. sudo apt-get install zlib-bin
  13. sudo apt-get install zlib1g-dev
  14. sudo apt-get install libreadline5-dev
  15. perl 5.1.0
  16. postgresql 8.4.3
    1. sudo ./configure --with-perl --with-python
    2. sudo make
    3. sudo make install
    4. sudo apt-get install postgresql-client-8.4
    5. sudo mkdir /usr/local/pgsql/data
    6. sudo adduser postgres (pw=samsung)
    7. sudo chown postgres data/
    8. su - postgres
    9. /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
    10. /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data >logfile 2>&1 &
    11. /usr/bin/createdb testdb
    12. createlang plpgsql
  17. postgis (http://www.postgis.org/download/postgis-2.0.0SVN.tar.gz)
    1. sudo apt-get install libpq-dev
    2. sudo apt-get install postgresql-server-dev-8.4
    3. sudo apt-get install libxml2-dev
    4. export PATH=/usr/local/pgsql/bin:$PATH
    5. sudo ./configure --with-geos --with-pgsql --with-proj --prefix=/usr/local/pgsql
    6. sudo make
    7. sudo make install
    8. psql -f rt_pg/rtpostgis.sql testdb
  18. gdal 1.7.1
    1. sudo ./configure --with-perl --with-python --with-ogr --with-xerces --with-pg=/usr/local/pgsql/bin/pg_config
    2. sudo make
    3. sudo make install
  19. sudo apt-get install swig
  20. sudo apt-get install python-dev
  21. numpy
    1. sudo apt-get install libatlas-base-dev
    2. sudo apt-get install libatlas3gf-sse2
    3. python setup.py build
    4. python setup.py install
  22. wktraster
    Note the version stayed the same but download on 2010-07-08 file size was different.
    also after make install, needed to 'cp /usr/local/src/wktraster-0.1.6d/rt_pg/rtpostgis.so /usr/local/pgsql/lib'
    1. sudo ./configure -with-postgis-sources=/usr/local/src/postgis-2.0.0SVN
    2. sudo make
    3. sudo make check
    4. sudo make install
    5. make post-install-check (as postgres user)
  23. PostGIS
    1. /usr/local/pgsql/bin/createdb testdb
    2. psql -d testdb -f /usr/share/postgresql/8.4/contrib/postgis-2.0/postgis.sql
    3. psql -f /usr/local/src/wktraster-0.1.6d/rt_pg/rtpostgis.sql testdb
    4. /usr/local/pgsql/bin/gdal2wktraster.py -r /mnt/hgfs/junk/percentpark1.tif -t percentpark | psql testdb
    5. Get point data values
      1. select x, y, st_value(rast, 1, x, y) as val into like_wow from percentpark cross join (select cast((st_x(the_geom)-1220334.12)/98.43 as int) as x from dens_pts) as x cross join (select cast((287678.357-st_y(the_geom))/98.43 as int) as y from dens_pts) as y;
      2. testdb=# select st_value(rast, 1, x, y) as val, x, y from percentpark cross join cast(1000 as int) as x cross join cast((2000 + 100) / 30 as int) as y;
        NOTICE: Pixel coordinates (1000, 70)
        val | x | y
        ------------------+------+----
        2.60653710365295 | 1000 | 70
        (1 row)