I am using postgis functions i.e. ST_Clip, ST_PixelHeight.

But I am getting this error -

ERROR: rt_raster_load_offline_data: Access to offline bands disabled

Actually, I have loaded my raster to postgis using


In raster2pgsql I have used -R option for saving only the metadata of the raster and path location to the raster in the database (not the pixels).

How to solve this issue ?


Have you set the environment variables to enable rasters ?

As of PostGIS 2.1.3, out-of-db rasters and all raster drivers are disabled by default. In order to re-enable these, you need to set the following environment variables: POSTGIS_GDAL_ENABLED_DRIVERS and POSTGIS_ENABLE_OUTDB_RASTERS in the server environment.

If you want to enable offline raster:

Any other setting or no setting at all will disable out of db rasters.

In order to enable all GDAL drivers available in your GDAL install, set this environment variable as follows


From http://postgis.net/docs/postgis_installation.html#install_short_version

| improve this answer | |
  • In recent versions of PostGIS, these can be set at the database or cluster level instead of using environment variables. ALTER SYSTEM SET postgis.gdal_enabled_drivers='GTiff'; ALTER SYSTEM SET postgis.enable_outdb_rasters='on'; SELECT pg_reload_conf(); – dbaston Nov 30 '18 at 16:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.