Difference between revisions of "Main Page/Stuff/Ubuntu stuff/server 9.10"
From phurvitz
< Main Page | Stuff | Ubuntu stuff
Phil Hurvitz (talk | contribs) |
Phil Hurvitz (talk | contribs) |
||
(10 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | This was mainly to try the wkt raster functionality in PostGIS. It is not promising as of 2010.03.26 for any meaningful work. | ||
+ | |||
+ | <tt> | ||
# install the server on a vm | # install the server on a vm | ||
# sudo apt-get update | # sudo apt-get update | ||
− | # sudo apt-get xinit | + | # sudo apt-get install xinit |
# sudo apt-get install kubuntu-desktop | # sudo apt-get install kubuntu-desktop | ||
# restart | # restart | ||
Line 33: | Line 36: | ||
## /usr/bin/createdb testdb | ## /usr/bin/createdb testdb | ||
## createlang plpgsql | ## createlang plpgsql | ||
+ | # postgis (http://www.postgis.org/download/postgis-2.0.0SVN.tar.gz) | ||
+ | ## sudo apt-get install libpq-dev | ||
+ | ## sudo apt-get install postgresql-server-dev-8.4 | ||
+ | ## sudo apt-get install libxml2-dev | ||
+ | ## export PATH=/usr/local/pgsql/bin:$PATH | ||
+ | ## sudo ./configure --with-geos --with-pgsql --with-proj --prefix=/usr/local/pgsql | ||
+ | ## sudo make | ||
+ | ## sudo make install | ||
+ | ## psql -f rt_pg/rtpostgis.sql testdb | ||
+ | # gdal 1.7.1 | ||
+ | ## sudo ./configure --with-perl --with-python --with-ogr --with-xerces --with-pg=/usr/local/pgsql/bin/pg_config | ||
+ | ## sudo make | ||
+ | ## sudo make install | ||
+ | # sudo apt-get install swig | ||
+ | # sudo apt-get install python-dev | ||
+ | # numpy | ||
+ | ## sudo apt-get install libatlas-base-dev | ||
+ | ## sudo apt-get install libatlas3gf-sse2 | ||
+ | ## python setup.py build | ||
+ | ## python setup.py install | ||
+ | # 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' | ||
+ | ## sudo ./configure -with-postgis-sources=/usr/local/src/postgis-2.0.0SVN | ||
+ | ## sudo make | ||
+ | ## sudo make check | ||
+ | ## sudo make install | ||
+ | ## make post-install-check (as postgres user) | ||
+ | # PostGIS | ||
+ | ## /usr/local/pgsql/bin/createdb testdb | ||
+ | ## psql -d testdb -f /usr/share/postgresql/8.4/contrib/postgis-2.0/postgis.sql | ||
+ | ## psql -f /usr/local/src/wktraster-0.1.6d/rt_pg/rtpostgis.sql testdb | ||
+ | ## /usr/local/pgsql/bin/gdal2wktraster.py -r /mnt/hgfs/junk/percentpark1.tif -t percentpark | psql testdb | ||
+ | ## Get point data values | ||
+ | ### 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; | ||
+ | ### 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) | ||
+ | </tt> |
Latest revision as of 18:41, 20 September 2010
This was mainly to try the wkt raster functionality in PostGIS. It is not promising as of 2010.03.26 for any meaningful work.
- install the server on a vm
- sudo apt-get update
- sudo apt-get install xinit
- sudo apt-get install kubuntu-desktop
- restart
- sudo apg-get install g++
- download and install python from source (2.6.5)
- sudo apt-get install libtool
- geos 3.2.0
- sudo ./configure
- sudo make
- sudo make install
- proj4 4.7.0
- sudo ./configure
- sudo make
- sudo make install
- sudo apt-get install libreadline-dev
- sudo apt-get install zlib-bin
- sudo apt-get install zlib1g-dev
- sudo apt-get install libreadline5-dev
- perl 5.1.0
- postgresql 8.4.3
- sudo ./configure --with-perl --with-python
- sudo make
- sudo make install
- sudo apt-get install postgresql-client-8.4
- sudo mkdir /usr/local/pgsql/data
- sudo adduser postgres (pw=samsung)
- sudo chown postgres data/
- su - postgres
- /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
- /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data >logfile 2>&1 &
- /usr/bin/createdb testdb
- createlang plpgsql
- postgis (http://www.postgis.org/download/postgis-2.0.0SVN.tar.gz)
- sudo apt-get install libpq-dev
- sudo apt-get install postgresql-server-dev-8.4
- sudo apt-get install libxml2-dev
- export PATH=/usr/local/pgsql/bin:$PATH
- sudo ./configure --with-geos --with-pgsql --with-proj --prefix=/usr/local/pgsql
- sudo make
- sudo make install
- psql -f rt_pg/rtpostgis.sql testdb
- gdal 1.7.1
- sudo ./configure --with-perl --with-python --with-ogr --with-xerces --with-pg=/usr/local/pgsql/bin/pg_config
- sudo make
- sudo make install
- sudo apt-get install swig
- sudo apt-get install python-dev
- numpy
- sudo apt-get install libatlas-base-dev
- sudo apt-get install libatlas3gf-sse2
- python setup.py build
- python setup.py install
- 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'
- sudo ./configure -with-postgis-sources=/usr/local/src/postgis-2.0.0SVN
- sudo make
- sudo make check
- sudo make install
- make post-install-check (as postgres user)
- PostGIS
- /usr/local/pgsql/bin/createdb testdb
- psql -d testdb -f /usr/share/postgresql/8.4/contrib/postgis-2.0/postgis.sql
- psql -f /usr/local/src/wktraster-0.1.6d/rt_pg/rtpostgis.sql testdb
- /usr/local/pgsql/bin/gdal2wktraster.py -r /mnt/hgfs/junk/percentpark1.tif -t percentpark | psql testdb
- Get point data values
- 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;
- 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)