10

I'm trying to install GDAL 2.x on my CentOS 7.4 server.

I looked at what is available, and it is still at v 1.11 of GDAL

Since I need GDAL v 2.x along with libKML support, looks like I'll have to build it from source.

I looked at the documentation for building from source, and I found the details unclear.

  • What options to give when configuring the make file?
  • How do I specify that I need the libKMl & PostGreSQL Drivers?

Is there a Page/documentation which shows how GDAL 2.x can be compiled from source on a CentOS 7.4 server?

3 Answers 3

13

I found this answer which pointed me in the correct direction: https://gis.stackexchange.com/a/120103/442

I just had to update the GDAL version there.

These are the commands that I used to get a successful deployment of GDAL v2.x

#Install the tools that we will use
yum groupinstall "Development Tools"
yum install wget

#for Postgresql support
sudo yum install postgresql postgresql-devel

#libkml Support
##---------This part is depending on prebuilt libraries. In the future we may replace this by compiling them from source.
wget http://s3.amazonaws.com/etc-data.koordinates.com/gdal-travisci/install-libkml-r864-64bit.tar.gz
tar xzf install-libkml-r864-64bit.tar.gz

#Copy these required files to  /usr/local
sudo cp -r install-libkml/include/* /usr/local/include
sudo cp -r install-libkml/lib/* /usr/local/lib
sudo ldconfig


#download GDAL
wget http://download.osgeo.org/gdal/2.2.3/gdal-2.2.3.tar.gz

#Untar
tar xzf gdal-2.2.3.tar.gz
cd gdal-2.2.3

#Compile from source
./configure --with-libkml 
make
make install
3
  • Hey can you tell us a way we can do it on heroku. Commented Jan 9, 2018 at 9:11
  • @SandeepKumar: I don't know any thing about heroku, but this would be a great question for you to ask here. Commented Jan 12, 2018 at 6:53
  • Does this install for all users?
    – Brian D
    Commented Jun 12, 2019 at 18:43
3

I encountered the same error concerning SFCGAL library and I solve it installing the corresponding devel library

e.g. on Centos 7.4

sudo yum install SFCGAL-devel

I hope it can be useful also for you

0

I experienced this issue and solved it by doing the following:

yum -y install epel-release

Found this on AN ALMOST IDIOT'S GUIDE TO INSTALL POSTGRESQL 9.5, POSTGIS 2.2 AND PGROUTING 2.1.0 WITH YUM

Which I got to through https://postgis.net/install/

Section:

Red Hat / Centos / Scientific Linux

  1. Refer to Install PostgreSQL 9.5, PostGIS 2.2, pgRouting 2.1 with Yum for more detailed instructions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.