Reiion Reiion - 1 month ago 15
Linux Question

Check version/if installed in Ubuntu Command Line: PROJ4 and GEOS

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? Thanks!

Edit (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


Answer

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:~$