Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check version/if installed PROJ4

I'm really new in working with Geospatial Libraries and I was able to install GDAL and PostGIS already. I just wanted to check if I was really able to include the packages GEOS and PROJ4 that is a requirement for PostGIS.

What command lines should I type in to check their versions or if they are installed?

I just need the proj4 checking:

PostGreSQL version : $ psql --version

PostGIS version : Connect to your database, =# SELECT PostGIS_full_version();

GDAL version: $ gdal-info --version

GEOS version: $ geos-config --version

like image 386
Reiion Avatar asked Nov 01 '16 00:11

Reiion


2 Answers

I recommend using pkg-config if you can as it allows you to query

  • if a library is installed
  • what version is installed
  • whether the version passes a minimum version required comparison

and actually just detailed all of that in a comment to the sf repo which is also in the geo-spatial space.

Quoting:

edd@max:~$ pkg-config --atleast-version=2.1.0 gdal && echo "Yes we are good"
edd@max:~$ pkg-config --atleast-version=2.1.0 gdal || echo "Insufficient"
Insufficient
edd@max:~$ 

I don't have proj4 installed so I can't illustrate that.

Edit: I spoke too soon -- I do have it:

edd@max:~$ pkg-config --modversion proj
4.9.2
edd@max:~$ pkg-config --atleast-version=4.9.0 proj && echo "Yes"
Yes
edd@max:~$ 
like image 142
Dirk Eddelbuettel Avatar answered Sep 20 '22 13:09

Dirk Eddelbuettel


To add to the OP's list of commands: Typing just proj in the command line will also give you the installed version of the PROJ library.

like image 25
andschar Avatar answered Sep 18 '22 13:09

andschar