[postgis-users] out db: not able to query the raster

Jorge Gustavo Rocha jgr at di.uminho.pt
Wed Dec 6 14:25:11 PST 2023


Hi Andrea,

I always put the raster somewhere below Postgresql data_directory.

psql
show data_directory;

I hope it helps.

Saluti,

Jorge

On 04/12/23 22:23, andy via postgis-users wrote:
> Hi,
> if I run "SELECT (ST_BandMetaData(rast)).* FROM rasters_outdb LIMIT 
> 1;", in the field path I have "/directory_docker/ou_s6_01_01_stack.tif"
>
> If I run "ls -l /directory_docker/ou_s6_01_01_stack.tif" I have
>
> -rwxr--r-- 1 1000 1000 2100227 Dec  4 08:32 
> /directory_docker/ou_s6_01_01_stack.tif
>
> But when I run "SELECT ST_Value(rast, 1, 1) FROM rasters_outdb;" I get
>
> ERROR:  rt_band_load_offline_data: Cannot open offline raster: 
> /directory_docker/ou_s6_01_01_stack.tif
>
> Why is it offline? It's there.
> I'm using postgis/postgis:16-master
>
> I have created the sql file to load it in postgres, running
>
> raster2pgsql -I -C -M -F -t auto -R 
> /directory_docker/ou_s6_01_01_stack.tif public.rasters_outdb
>
> How to read the pixel values using a PG SQL query?
>
> Thank you
>
> -- 
> ___________________
>
> Andrea Borruso
> website: https://medium.com/tantotanto
> 38° 7' 48" N, 13° 21' 9" E, EPSG:4326
> ___________________
>
> "cercare e saper riconoscere chi e cosa,
>  in mezzo all’inferno, non è inferno,
> e farlo durare, e dargli spazio"
>
> Italo Calvino
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20231206/ebaf6a8f/attachment.htm>


More information about the postgis-users mailing list