Getting Setup With GDAL Using OSGeo4W

From Tuflow
Revision as of 01:25, 12 April 2022 by Ellis Symons (talk | contribs)
Jump to navigation Jump to search

The compiled GDAL binaries can be installed via OSGeo4W. Follow the instructions under Quick Start for OSGeo4W Users and choose "GDAL" as the package to install when prompted. The GDAL programs should be located in the installation directory, in the "bin" folder. As an example:

C:\OSGeo4W\bin

The GDAL programs should be ready to use as they are. For example the following batch file will use "gdal_translate.exe":

set gdal_translate="C:\OSGeo4W\bin\gdal_translate.exe"
%gdal_translate% <conversion_commands>

However if you receive errors while similar to "PROJ: proj_create_from_database: Cannot find proj.db" you should add this environment variable to the top of the batch file (Note: do not use quotes "" in path):

set PROJ_LIB=C:\OSGeo4W\share\proj
set gdal_translate="C:\Program Files\QGIS 3.24.1\bin\gdal_translate.exe"
%gdal_translate% <conversion_commands>


Up
Go-up.png Back to GDAL Tips and Tricks