14

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

Adrian Mole
  • 49,934
  • 160
  • 51
  • 83
Reiion
  • 923
  • 3
  • 15
  • 33
  • When I run `=# SELECT PostGIS_full_version();` as you have above, it displays the installed GEOS, PROJ and GDAL versions (among other info). – Jheasly Jul 07 '23 at 21:34

2 Answers2

16

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:~$ 
Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725
6

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.

andschar
  • 3,504
  • 2
  • 27
  • 35