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 ?
1 Answer 1
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
-
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– dbaston2018年11月30日 16:26:02 +00:00Commented Nov 30, 2018 at 16:26