Skip to content
HarryZhu edited this page May 1, 2018 · 4 revisions

SF Installation on Centos7

Dependency list

  1. gdal >= 2.1 # for data structure
  2. geos >= 3.5 # for data manipulation
  3. pro4j # for projection
  4. lwgeom # for geohash
  5. udunits

Centos7 default repo gives you gdal1.1, geos 2.x. However, sf::st_voronoi need geos >=3.5 and sf need gdal >= 2.1.

gdal installation

go to http://trac.osgeo.org/gdal/wiki/DownloadSource to fetch latest gdal version.

wget http://download.osgeo.org/gdal/2.2.4/gdal-2.2.4.zip

unzip and compile to install

unzip gdal-2.2.4.zip
cd gdal-2.2.4
./configure
make
make install

checkout you replaced the default gdal:

echo "/usr/local/lib" > /etc/ld.so.conf.d/libgdal-x86_64.conf
sudo ldconfig # relink to new gdal # need to relogin R

geos installation

install geos-devel for lwgeom

sudo yum install -y geos-devel

go to https://trac.osgeo.org/geos to get latest geos version.

wget http://download.osgeo.org/geos/geos-3.6.2.tar.bz2

unzip

tar -xjf geos-3.6.2.tar.bz2

and do the rest things like previous gdal process.

udunits2

install system dependency

sudo yum install  udunits2-devel
install.packages("udunits2",configure.args='--with-udunits2-include=/usr/include/udunits2/')

lwgeom

sudo yum install -y liblwgeom
install.packages("lwgeom")

References

Clone this wiki locally