CentOS 7にGDALとprojを入れる。

Pocket

CentOS 7にGDALを入れます。

メンテナンス性を考えると、yumで入れたい。

ということで、EPELのリポジトリを登録してGDALをインストールする。

1)EPELリポジトリの登録

まずはyumを使ってepel-releaseのリポジトリをインストールします。

# yum install epel-release
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * updates: ftp.iij.ad.jp
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-9 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                Arch             Version         Repository        Size
================================================================================
Installing:
 epel-release           noarch           7-9             extras            14 k

Transaction Summary
================================================================================
Install  1 Package

Total download size: 14 k
Installed size: 24 k
Is this ok [y/d/N]: y
Downloading packages:
epel-release-7-9.noarch.rpm                                |  14 kB   00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : epel-release-7-9.noarch                                      1/1
  Verifying  : epel-release-7-9.noarch                                      1/1

Installed:
  epel-release.noarch 0:7-9

Complete!

こんな感じでインストール完了!

epel-releaseリポジトリを明示的に使用する(通常は使用しないで、必要な時だけ使用する)場合は、以下の設定を行う。

# vi /etc/yum.repos.d/epel.repo

[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
#baseurl=https://download.fedoraproject.org/pub/epel/7/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
failovermethod=priority
enabled=1                        <=== ここを「0」にする。
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

この設定を行った場合には、yumのオプションに–enablerepo=epelを指定していないとEPEL-Releaseリポジトリは参照されません。

試しに、enabled=0の時と1にした時とでインストール対象が変わることを示します。

<EPEL-Releaseが参照されない(enabled=0)場合>

# yum list | grep proj
httpcomponents-project.noarch              6-4.el7                     base
jetty-project.noarch                       9.0.3-8.el7                 base
maven-project.noarch                       2.2.1-47.el7                base
maven-project-info-reports-plugin.noarch   2.6-8.el7                   base
maven-project-info-reports-plugin-javadoc.noarch

 

<EPEL-Releaseを参照する(enabled=1)場合>

# yum list | grep proj
fedora-gnat-project-common.noarch         3.9-1.el7                      epel
geany-plugins-projectorganizer.x86_64     1.28-1.el7                     epel
httpcomponents-project.noarch             6-4.el7                        base
jetty-project.noarch                      9.0.3-8.el7                    base
libprojectM.x86_64                        2.1.0-2.el7                    epel
libprojectM-devel.x86_64                  2.1.0-2.el7                    epel
libprojectM-qt.x86_64                     2.1.0-2.el7                    epel
libprojectM-qt-devel.x86_64               2.1.0-2.el7                    epel
maven-project.noarch                      2.2.1-47.el7                   base
maven-project-info-reports-plugin.noarch  2.6-8.el7                      base
maven-project-info-reports-plugin-javadoc.noarch
mingw32-angleproject.noarch               0-0.13.git.30d6c2.20141113.el7 epel
mingw32-angleproject-static.noarch        0-0.13.git.30d6c2.20141113.el7 epel
mingw64-angleproject.noarch               0-0.13.git.30d6c2.20141113.el7 epel
mingw64-angleproject-static.noarch        0-0.13.git.30d6c2.20141113.el7 epel
pjproject.x86_64                          2.3-6.el7                      epel
pjproject-devel.x86_64                    2.3-6.el7                      epel
proj.x86_64                               4.8.0-4.el7                    epel
proj-devel.x86_64                         4.8.0-4.el7                    epel
proj-epsg.x86_64                          4.8.0-4.el7                    epel
proj-nad.x86_64                           4.8.0-4.el7                    epel
proj-static.x86_64                        4.8.0-4.el7                    epel
projectM-jack.x86_64                      2.1.0-2.el7                    epel
projectM-pulseaudio.x86_64                2.1.0-2.el7                    epel
pyproj.x86_64                             1.9.2-6.20120712svn300.el7     epel

19-23行目でprojが参照されていることを確認できます。
この状態になると、projをyumでインストールすることが出来ます。

以下では、enabled=1(明示的に指定しないで使用する)で作業を進めます。

2)projのインストール

ここまで来たら簡単です!
projをインストールします。

# yum install proj proj-devel proj-epsg
Loaded plugins: fastestmirror
epel/x86_64/metalink                                     | 5.8 kB     00:00
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * epel: ftp.riken.jp
 * extras: ftp.iij.ad.jp
 * updates: ftp.iij.ad.jp
Resolving Dependencies
--> Running transaction check
---> Package proj.x86_64 0:4.8.0-4.el7 will be installed
---> Package proj-devel.x86_64 0:4.8.0-4.el7 will be installed
---> Package proj-epsg.x86_64 0:4.8.0-4.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package             Arch            Version                Repository     Size
================================================================================
Installing:
 proj                x86_64          4.8.0-4.el7            epel          181 k
 proj-devel          x86_64          4.8.0-4.el7            epel           16 k
 proj-epsg           x86_64          4.8.0-4.el7            epel           58 k

Transaction Summary
================================================================================
Install  3 Packages

Total download size: 256 k
Installed size: 1.1 M
Is this ok [y/d/N]: y
Downloading packages:
warning: /var/cache/yum/x86_64/7/epel/packages/proj-epsg-4.8.0-4.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
Public key for proj-epsg-4.8.0-4.el7.x86_64.rpm is not installed
(1/3): proj-epsg-4.8.0-4.el7.x86_64.rpm                    |  58 kB   00:00
(2/3): proj-4.8.0-4.el7.x86_64.rpm                         | 181 kB   00:00
(3/3): proj-devel-4.8.0-4.el7.x86_64.rpm                   |  16 kB   00:00
--------------------------------------------------------------------------------
Total                                              280 kB/s | 256 kB  00:00
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Importing GPG key 0x352C64E5:
 Userid     : "Fedora EPEL (7) <epel@fedoraproject.org>"
 Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5
 Package    : epel-release-7-9.noarch (@extras)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : proj-4.8.0-4.el7.x86_64                                      1/3
  Installing : proj-epsg-4.8.0-4.el7.x86_64                                 2/3
  Installing : proj-devel-4.8.0-4.el7.x86_64                                3/3
  Verifying  : proj-epsg-4.8.0-4.el7.x86_64                                 1/3
  Verifying  : proj-4.8.0-4.el7.x86_64                                      2/3
  Verifying  : proj-devel-4.8.0-4.el7.x86_64                                3/3

Installed:
  proj.x86_64 0:4.8.0-4.el7              proj-devel.x86_64 0:4.8.0-4.el7
  proj-epsg.x86_64 0:4.8.0-4.el7

Complete!

おしまし!。。。じゃない、まだGDAL入れてないしw

3)GDALのインストール

GDALのインストール手順を書きすれていました(^^;

こんな感じです。

# yum -y install gdal gdal-devel

出力されているコメントを見るとOGRの名前が見当たりませんが、OGRもしっかりと入っています!

試しにこんな感じで確認できます。

# ogrinfo 
Usage: ogrinfo [--help-general] [-ro] [-q] [-where restricted_where]
               [-spat xmin ymin xmax ymax] [-geomfield field] [-fid fid]
               [-sql statement] [-dialect sql_dialect] [-al] [-so] [-fields={YES/NO}]
               [-geom={YES/NO/SUMMARY}][--formats]
               datasource_name [layer [layer ...]]

FAILURE: No datasource specified.

ということで、今度こそおしまい!

 

コメントを残す

メールアドレスが公開されることはありません。

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください