5

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

raster2pgsql

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 ?

asked Apr 16, 2015 at 6:38

1 Answer 1

9

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:

POSTGIS_ENABLE_OUTDB_RASTERS=1
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

POSTGIS_GDAL_ENABLED_DRIVERS=ENABLE_ALL

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

answered Apr 16, 2015 at 7:08
1
  • 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(); Commented Nov 30, 2018 at 16:26

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.