{"id":4508,"date":"2020-03-10T16:58:22","date_gmt":"2020-03-10T16:58:22","guid":{"rendered":"http:\/\/ri.itservices.manchester.ac.uk\/csf3\/?page_id=4508"},"modified":"2026-03-29T14:42:22","modified_gmt":"2026-03-29T13:42:22","slug":"gdal","status":"publish","type":"page","link":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/software\/libraries\/gdal\/","title":{"rendered":"GDAL"},"content":{"rendered":"<h2>Overview<\/h2>\n<p><a href=\"https:\/\/gdal.org\/\">GDAL<\/a> is a translator library for raster and vector geospatial data formats. As a library, it presents a single raster abstract data model and single vector abstract data model to the calling application for all supported formats. It also comes with a variety of useful command line utilities for data translation and processing. <\/p>\n<h2>Restrictions on use<\/h2>\n<p>There are no restrictions on access to the GDAL libraries on CSF. The software is released under a <a href=\"https:\/\/gdal.org\/license.html#license\">MIT\/X-like license<\/a>. All usage must adhere to this license.<\/p>\n<h2>Set up procedure<\/h2>\n<p>We now recommend loading modulefiles within your jobscript so that you have a full record of how the job was run. See the example jobscript below for how to do this. Alternatively, you may load modulefiles on the login node and let the job <abbr title=\"add '#$ -V' to your jobscript\">inherit these settings<\/abbr>.<\/p>\n<p>Load <strong>one<\/strong> of the following modulefiles to set up your environment:<\/p>\n<pre>\r\nmodule load libs\/gcc\/gdal\/3.12.2              # Uses CSF3_EL9 system default GCC 11.5.0 compiler.\r\n                                              # Includes support for HDF5 1.14.3, HDF4 4.3.1,\r\n                                              # NetCDF 4.9.3, GEOS 3.14.1 and PROJ 9.1.1\r\n                                              # (these modulefiles will be loaded automatically)\r\n\r\nmodule load libs\/gcc\/gdal\/2.4.4               # Uses system default GCC 4.8.5 compiler.\r\n                                              # Includes support for HDF5 1.8.21, NetCDF 4.6.2\r\n                                              # and GEOS 3.8.0 (these modulefiles will be\r\n                                              # loaded automatically)\r\n\r\nmodule load libs\/intel-18.0\/gdal\/2.4.4        # Use the Intel 18.0 compiler. Does <strong>NOT<\/strong> include\r\n                                              # HDF5, NetCDF and GEOS support. It <em>may<\/em> provide\r\n                                              # better performance than the gcc version.\r\n<\/pre>\n<h2>Compiling an GDAL-capable application<\/h2>\n<p>You will mostly use the GDAL installation on CSF3 when compiling your own software. This allows you to add GDAL functionality to your own apps. There are some tools you can also run to process existing data files (see below).<\/p>\n<p>The modulefiles will set an environment variable named <code>${GDALDIR}<\/code> which can then be used in your compilation process (e.g., in a Makefile or directly on the command-line) to access the header and library files:<\/p>\n<ul>\n<li>To inform the compiler of the header file directory use:\n<pre>gcc -I${GDALDIR}\/include ....<\/pre>\n<\/li>\n<li>To inform the compiler of the library files use:\n<pre>gcc ... -L${GDALDIR}\/lib -lgdal<\/pre>\n<\/li>\n<li>In a Makefile ensure you use <code>${GDALDIR}<\/code> rather than <code>$GDALDIR<\/code>.<\/li>\n<li>The <code>gdal-config<\/code> application will be added to your <code>PATH<\/code> environment variable &#8211; some applications may run this to determine where the GEOS files are installed.<\/li>\n<\/ul>\n<p>An example compilation command could be<\/p>\n<pre>\r\ngcc -I${GDALDIR}\/include example_gdal.c -o example_gdal -L${GDALDIR}\/lib -lgdal\r\n<\/pre>\n<h2>Running an GDAL-capable application<\/h2>\n<p>You must load the GDAL modulefile before running your GDAL-capable application (unless you have statically linked your code against the GDAL libraries). <\/p>\n<p>Please do not run GDAL-capable applications on the login node. Jobs should be submitted to the compute nodes via batch.<\/p>\n<h3>Serial batch job submission<\/h3>\n<p>Create a batch submission script (which will load the modulefile in the jobscript), for example:<\/p>\n<pre>\r\n#!\/bin\/bash --login\r\n#$ -cwd             # Job will run from the current directory\r\n                    # NO -V line - we load modulefiles in the jobscript\r\n\r\n# Load the serial (non-MPI) modulefile\r\nmodule load libs\/gcc\/gdal\/2.4.4\r\n\r\n# Run my application I compiled earlier\r\n.\/<em>mygdalapp<\/em> <em>arg1<\/em> ...\r\n<\/pre>\n<p>Submit the jobscript using: <\/p>\n<pre>qsub <em>scriptname<\/em><\/pre>\n<p>where <em>scriptname<\/em> is the name of your jobscript.<\/p>\n<h3>GDAL Tools<\/h3>\n<p>The GDAL <code>bin<\/code> directory is added to your path so that you can access the <code>gdal...<\/code> tools. Use <code>ls ${GDALBIN}<\/code> to see all binary tools:<\/p>\n<pre>\r\n# GDAL tools - must be used in batch jobs, as above\r\ngdaladdo      gdalenhance       gdal_rasterize  gdal_translate  ogr2ogr\r\ngdalbuildvrt  gdal_grid         gdalserver      gdalwarp        ogrinfo\r\ngdal-config   gdalinfo          gdalsrsinfo     gnmanalyse      ogrlineref\r\ngdal_contour  gdallocationinfo  gdaltindex      gnmmanage       ogrtindex\r\ngdaldem       gdalmanage        gdaltransform   nearblack       testepsg\r\n<\/pre>\n<h2>Further info<\/h2>\n<p>See the GDAL website for <a href=\"https:\/\/gdal.org\/\">full documentation<\/a>.<\/p>\n<h2>Updates<\/h2>\n<p>None.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview GDAL is a translator library for raster and vector geospatial data formats. As a library, it presents a single raster abstract data model and single vector abstract data model to the calling application for all supported formats. It also comes with a variety of useful command line utilities for data translation and processing. Restrictions on use There are no restrictions on access to the GDAL libraries on CSF. The software is released under a.. <a href=\"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/software\/libraries\/gdal\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":140,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-4508","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/4508","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/comments?post=4508"}],"version-history":[{"count":5,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/4508\/revisions"}],"predecessor-version":[{"id":12206,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/4508\/revisions\/12206"}],"up":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/140"}],"wp:attachment":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/media?parent=4508"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}