GRESS GIS Memo

更新日2010-11-01 (月) 10:16:11

インストール

GRASS GIS (6.4.0)というオープンソースの地図ソフトをVine 5.1にインストール
必要なソフトを以下の順でインストールする

PROJ.4のインストール

http://trac.osgeo.org/proj/からrpm版をダウンロード

$ wget ftp://ftp.remotesensing.org/proj/proj-4.4.8-1.i386.rpm
# rpm -ivh proj-4.4.8-1.i386.rpm
準備中...                ########################################### [100%]
   1:PROJ                   ########################################### [100%]

RPMでVineのソフトを追加

postgresql, postgresql-devel
MySQL-client, MySQL-devel
unixODBC(インストールすみ), unixODBC-devel
sqlite, sqlite-devel

# apt-get install postgresql-devel
# apt-get install postgresql
# apt-get install MySQL-client
# apt-get install MySQL-devel
# apt-get install unixODBC-devel
# apt-get install sqlite-devel
# apt-get install readline-devel
# apt-get install tk

GEOSのインストール

http://trac.osgeo.org/geos/からSourceをダウンロード

$ wget http://download.osgeo.org/geos/geos-3.2.2.tar.bz2
$ tar zxvf geos-3.2.2.tar.bz2
$ cd geos-3.2.2
$ ./configure

(略)

config.status: creating source/headers/geos/platform.h
config.status: executing depfiles commands
config.status: executing libtool commands
Swig: false
Python: false
Ruby: false

$ make
$ su
# make install

gdalをインストール

http://www.gdal.org/ ( ftp://ftp.remotesensing.org/gdal )からSourceをダウンロード

$ wget ftp://ftp.remotesensing.org/gdal/gdal-1.7.2.tar.gz
$ tar zxvf gdal-1.7.2.tar.gz
$ cd gdal-1.7.2
$ ./configure

(略)
config.status: creating GDALmake.opt
config.status: WARNING:  'GDALmake.opt.in' seems to ignore the --datarootdir  setting
config.status: creating port/cpl_config.h
config.status: executing libtool commands

GDAL is now configured for i686-pc-linux-gnu

  Installation directory:    /usr/local
  C compiler:                gcc -g -O2
  C++ compiler:              g++ -g -O2
 
  LIBTOOL support:           yes

  LIBZ support:              internal
  GRASS support:             no
  CFITSIO support:           no
  PCRaster support:          internal
  NetCDF support:            no
  LIBPNG support:            internal
  LIBTIFF support:           internal (BigTIFF=yes)
  LIBGEOTIFF support:        internal
  LIBJPEG support:           internal
  8/12 bit JPEG TIFF:        yes
  LIBGIF support:            internal
  OGDI support:              no
  HDF4 support:              no
  HDF5 support:              no
  Kakadu support:            no
  JasPer support:            no
  ECW support:               no
  MrSID support:             no
  MSG support:               no
  GRIB support:              yes
  EPSILON support:           no
  cURL support (wms/wcs/...):no
  PostgreSQL support:        yes
  MySQL support:             no
  Ingres support:            no
  Xerces-C support:          no
  NAS support:               no
  Expat support:             no
  ODBC support:              yes
  PGeo support:              yes
  PCIDSK support:            internal
  OCI support:               no
  GEORASTER support:         no
  SDE support:               no
  DODS support:              no
  SQLite support:            no
  SpatiaLite support:        no
  DWGdirect support          no
  INFORMIX DataBlade support:no
  GEOS support:              yes
  VFK support:               yes


  SWIG Bindings:          no

  Statically link PROJ.4:    no
  enable OGR building:       yes
  enable pthread support:    no
  hide internal symbols:     no

$ make
$ su
# make install

VineからRPMでさらに追加インストール

fftw3, fftw3-devel
libjpeg-devel, libtiff-devel, libpng-devel

xorg-x11-devel, xorg-x11-libs,
libXmu-devel,libXext-devel
libRmath-devel(不要かも)

# apt-get install fftw3-devel
# apt-get install libjpeg-devel
# apt-get install libpng-devel
# apt-get install libtiff-devel
# apt-get install xorg-x11-devel
# apt-get install xorg-x11-libs
(# apt-get install libRmath-devel) 不要?
# apt-get install freeglut-devel

Rの導入

 Rの前に以下のソフトをaptで導入 gcc-g77(gcc3-g77)

# apt-get install gcc3-g77

http://cran.r-project.org/からSourceをダウンロード。R-2.12.0はうまくコンパイルできなかったのでひとつ前のR-2.11.1をインストール

$ wget http://cran.r-project.org/src/base/R-2/R-2.11.1.tar.gz
$ tar zxvf R-2.11.1.tar.gz
$ cd R-2.11.1
$ ./configure

(略)
config.status: creating po/POTFILES
config.status: creating po/Makefile
config.status: executing stamp-h commands

R is now configured for i686-pc-linux-gnu

  Source directory:          .
  Installation directory:    /usr/local

  C compiler:                gcc -std=gnu99  -g -O2
  Fortran 77 compiler:       g77  -g -O2

  C++ compiler:              g++  -g -O2
  Fortran 90/95 compiler:    g77 -g -O2
  Obj-C compiler:

  Interfaces supported:      X11, tcltk
  External libraries:        readline
  Additional capabilities:   PNG, JPEG, TIFF, NLS
  Options enabled:           shared BLAS, R profiling

  Recommended packages:      yes

$ make

make checkでエラーをした原因は別途調査だがとりあえず前に進む

$ make check  

(略)
パッケージに対する例を集めています  ‘methods’
  Extracting from parsed Rd's .......
パッケージ中の例を実行中 ‘methods’
 エラー:  'methods' のテストに失敗しました
 実行が停止されました
make[3]: *** [test-Examples-Base] エラー 1
make[3]: ディレクトリ `/home/student/okada/R-2.11.1/tests/Examples' から出ます
make[2]: *** [test-Examples] エラー 2
make[2]: ディレクトリ `/home/student/okada/R-2.11.1/tests' から出ます
make[1]: *** [test-all-basics] エラー 1
make[1]: ディレクトリ `/home/student/okada/R-2.11.1/tests' から出ます
make: *** [check] エラー 2

$ su
# make install

GRASS GISのインストール

http://grass.fbk.eu/download/software.php#g64xからSourceをダウンロード。

$ wget http://grass.fbk.eu/grass64/source/grass-6.4.0.tar.gz

$ tar zxvf grass-6.4.0.tar.gz
$ cd grass-6.4.0
$ ./configure --with-postgres-includes=/usr/include/pgsql

(略)
creating include/winname.h
creating grass.pc
creating include/config.h
Copying config.status to config.status.i686-pc-linux-gnu

GRASS is now configured for:  i686-pc-linux-gnu

  Source directory:            /home/student/okada/grass-6.4.0
  Build directory:             /home/student/okada/grass-6.4.0
  Installation directory:      ${prefix}/grass-6.4.0
  Startup script in directory: ${exec_prefix}/bin
  C compiler:                  gcc -g -O2
  C++ compiler:
  Building shared libraries:   yes
  64bit support:               no
  OpenGL platform:             X11

  MacOSX application:         no
  MacOSX architectures:
  MacOSX SDK:

  NVIZ:                       yes

  BLAS support:               no
  C++ support:                no
  Cairo support:              no
  DWG support:                no
  FFMPEG support:             no
  FFTW support:               yes
  FreeType support:           no
  GDAL support:               yes
  GLw support:                no
  JPEG support:               yes
  LAPACK support:             no
  Large File support (LFS):   no
  Motif support:              no
  MySQL support:              no
  NLS support:                no
  ODBC support:               no
  OGR support:                yes
  OpenGL support:             yes
  PNG support:                yes
  PostgreSQL support:         no
  Python support:             no
  Readline support:           no
  SQLite support:             no
  Tcl/Tk support:             yes
  wxWidgets support:          no
  TIFF support:               yes
  X11 support:                yes


$ make

(略)
Generating HTML manual pages index (help system)...
Generated HTML docs in ../dist.i686-pc-linux-gnu/docs/html/index.html
----------------------------------------------------------------------
Following modules are missing the 'description.html' file in src code:
----------------------------------------------------------------------
GRASS GIS compilation log
-------------------------
Started compilation: 2010年 10月 19日 火曜日 17:05:11 JST
--
Errors in:
No errors detected.
--
Finished compilation: 2010年 10月 19日 火曜日 17:09:26 JST
$ su
# make install

追加処理

# apt-get install PyOpenGL

/usr/local/libにライブラリパスが通っていなので追加

/etc/ld.so.conf

include ld.so.conf.d/*.conf
/usr/local/lib               <=追加
/usr/local/grass-6.4.0/lib/  <=追加

 # /sbin/ldconfig

インストールされた場所に環境変数「$GISBASE」にパスを指定

$ export GISBASE="/usr/local/grass-6.4.0"

wxPythonをインストールしないと以下のようなエラーが出るし、textで起動してもあとトラブルが発生した

ERROR: wxGUI requires wxPython. No module named wxversion

以下から

http://biokids.org/?Vine5%20RPM%A5%D1%A5%C3%A5%B1%A1%BC%A5%B8%2FwxPython%202.8.10.1-1vl5

エラー

GUIで起動するとまだ以下のようなエラーが出るので「numpy]をインストール

http://ftp-srv3.kddilabs.jp/Linux/Vine/VineSeed/i386/pool/ にある

そこでrpm.srcをseedからDLしてコンパイル後rpmでインストール

事前に以下のrpmもインストール

# apt-get install python-nose
# apt-get install python-devel
# apt-get install blas
# apt-get install lapack
# apt-get install lapack-devel
# apt-get install gcc-gfortran

http://ftp-srv3.kddilabs.jp/Linux/Vine/VineSeed/SRPMS.plus/ から「numpy-1.4.1-8vl6.src.rpm」をDL

rpmの作成

[okada@localhost SRPMS]$ rpm --rebuild numpy-1.4.1-8vl6.src.rpm

$ cd /home/okada/rpm/RPMS/i386
$ ls
numpy-1.4.1-8vl5.i386.rpm  numpy-f2py-1.4.1-8vl5.i386.rpm

$ su
# rpm -ivh numpy-1.4.1-8vl5.i386.rpm  numpy-f2py-1.4.1-8vl5.i386.rpm

まだ「Start GRASS]で

Execution failed: 'g.proj -p'

Details: 
Error: Projection files missing

出るが一度text起動でファイルを作成するとでなくなる

動作確認

サンプルデータ

http://grass.fbk.eu/download/data6.phpからダウンロード

$ cd okada/
$ wget http://grass.fbk.eu/sampledata/spearfish_grass60data-0.3.tar.gz
$ tar zxvf spearfish_grass60data-0.3.tar.gz
$ gress64
                            GRASS 6.4.0

DATABASE: A directory (folder) on disk to contain all GRASS maps and data. 

LOCATION: This is the name of a geographic location. It is defined by a
          co-ordinate system and a rectangular boundary.

MAPSET:   Each GRASS session runs under a particular MAPSET. This consists of
          a rectangular REGION and a set of maps. Every LOCATION contains at
          least a MAPSET called PERMANENT, which is readable by all sessions.

         The REGION defaults to the entire area of the chosen LOCATION.
         You may change it later with the command: g.region
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

LOCATION:   spearfish60______________  (enter list for a list of locations)
MAPSET:     PERMANENT________________  (or mapsets within a location)

DATABASE: /home/student/okada/_________________________________________________  



           AFTER COMPLETING ALL ANSWERS, HIT <ESC><ENTER> TO CONTINUE
                            (OR <Ctrl-C> TO CANCEL)

以下のように入力

LOCATION:   spearfish60______________  (enter list for a list of locations)
MAPSET:     PERMANENT________________  (or mapsets within a location)
 DATABASE: /home/student/okada/_________________________________________________  

(ここはspearfish60解凍したディレクトリ)

その後<ESC>+<ENTER>

         __________  ___   __________    _______________
         / ____/ __ \/   | / ___/ ___/   / ____/  _/ ___/
        / / __/ /_/ / /| | \__ \\_  \   / / __ / / \__ \ 
       / /_/ / _, _/ ___ |___/ /__/ /  / /_/ // / ___/ / 
       \____/_/ |_/_/  |_/____/____/   \____/___//____/  

Welcome to GRASS 6.4.0 (2010) 
GRASS homepage:                          http://grass.osgeo.org/
This version running thru:               Bash Shell (/bin/bash)
Help is available with the command:      g.manual -i
See the licence terms with:              g.version -c
Start the GUI with:                      g.gui wxpython
When ready to quit enter:                exit

GRASS 6.4.0 (spearfish60):~ > d.m &

「Add raster layer]を押す。

grass1.png

現れた「raster 1」の文字列をクリックすると下のペインに現れた「Raster name:」ボタンを押す 「landconver.30m]を選択

grass2.png

「Display active layers...」のボタンを押すと次の図が表示

grass3.png

3次元表示

grass4.png

参考


トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS