Skip to content

Instantly share code, notes, and snippets.

@hyhilman
Last active May 7, 2021 14:38
Show Gist options
  • Save hyhilman/037e48c6fbd7f5adfb29fd86e5cc87c2 to your computer and use it in GitHub Desktop.
Save hyhilman/037e48c6fbd7f5adfb29fd86e5cc87c2 to your computer and use it in GitHub Desktop.
gdal-bin centos 7

How to install ogr2ogr from source on CentOS (RHEL)

Install the following packages:

yum install gcc-c++
yum install gcc
yum install libpng
yum install libtiff

Build latest proj4

wget http://download.osgeo.org/proj/proj-4.7.0.tar.gz
tar -zvxf proj-4.7.0.tar.gz
cd proj-4.7.0
./configure
make
make install

Build latest gdal

wget http://download.osgeo.org/gdal/gdal-1.11.3.tar.gz
tar -zvxf gdal-1.11.3.tar.gz
cd gdal-1.11.3
./configure --with-static-proj4=/usr/local/lib --with-threads --with-libtiff=internal --with-geotiff=internal --with-jpeg=internal --with-gif=internal --with-png=internal --with-libz=internal
make
make install

Making ogr2ogr globally accessible

ln -s /usr/local/bin/ogr2ogr /usr/local/ogr2ogr
@raj-2011503554
Copy link

how to install with mysql support when i did this it was without mysql

can you please help i tried with --with-mysql but it was of no help

suggestion would be most welcomed

@sibienl
Copy link

sibienl commented May 7, 2021

how to install with mysql support when i did this it was without mysql

can you please help i tried with --with-mysql but it was of no help

suggestion would be most welcomed

You need to install mysql-devel before you can use --with-mysql, you can use it without value or just link it to mysql_config.

CentOS 7 supports GDAL 1.11 from repositories, so there's no need to build it from binaries, I used same method for GDAL 2.4.2 which I needed for MySQL 8 support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment