<div dir="ltr"><div dir="ltr">Hi all,<br>I had missed some messages, sorry.<br>But I still can't do a query on a raster.<br><br>I'll rewrite everything I've done.<br><br>I start with docker:<br><br>docker pull postgis/postgis:16-master<br><br>docker run --name postgis16 \<br>-p 5432:5432 \<br>-v /home/user/folder:/directory_docker \<br>-e POSTGRES_PASSWORD=thePassword \<br>-d postgis/postgis:16-master<br><br>Then I run<br><br>docker exec -it postgis16 bash<br><br>If I run "ls /directory_docker/" I get "ou_s6_01_01_stack.tif"<br><br>If I run "SELECT * FROM pg_ls_dir('/directory_docker');" I get "ou_s6_01_01_stack.tif"<br><br>Then I load this tif in postgres<br><br>raster2pgsql -I -C -M -F -t auto -R /directory_docker/ou_s6_01_01_stack.tif public.nome_tabella | psql -U postgres -d postgres<br><br>If I run<br><br>select * from nome_tabella limit 1;<br><br>I get something like<br><br>rid,rast,filename<br>1,01000....,ou_s6_01_01_stack.tif<br><br>Something that is strange for me is that there is no path, only the filename.<br><br>At the end I run "SELECT ST_Value(rast, 1, 1) FROM nome_tabella;" and I get<br><br>ERROR:  rt_band_load_offline_data: Cannot open offline raster: /directory_docker/ou_s6_01_01_stack.tif<br><br>Then I copy my tif in /var/lib/postgresql/data and I import it again using raster2pgsql.<br><br>I have again<br><br>ERROR:  rt_band_load_offline_data: Cannot open offline raster: /var/lib/postgresql/data/ou_s6_01_01_stack.tif<br><br><br>I'm sorry I'm boring you, it should be an immediate thing, I can't understand what the problem might be.<br><br>Thank you (below my tif metadata),<br></div><div dir="ltr"><br></div><div>Andrea</div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div>Tif Metadata, gdalinfo /directory_docker/ou_s6_01_01_stack.tif</div><div><br></div><div>Driver: GTiff/GeoTIFF<br>Files: /directory_docker/ou_s6_01_01_stack.tif<br>Size is 2500, 2280<br>Coordinate System is:<br>GEOGCRS["WGS 84",<br>    ENSEMBLE["World Geodetic System 1984 ensemble",<br>        MEMBER["World Geodetic System 1984 (Transit)"],<br>        MEMBER["World Geodetic System 1984 (G730)"],<br>        MEMBER["World Geodetic System 1984 (G873)"],<br>        MEMBER["World Geodetic System 1984 (G1150)"],<br>        MEMBER["World Geodetic System 1984 (G1674)"],<br>        MEMBER["World Geodetic System 1984 (G1762)"],<br>        MEMBER["World Geodetic System 1984 (G2139)"],<br>        ELLIPSOID["WGS 84",6378137,298.257223563,<br>            LENGTHUNIT["metre",1]],<br>        ENSEMBLEACCURACY[2.0]],<br>    PRIMEM["Greenwich",0,<br>        ANGLEUNIT["degree",0.0174532925199433]],<br>    CS[ellipsoidal,2],<br>        AXIS["geodetic latitude (Lat)",north,<br>            ORDER[1],<br>            ANGLEUNIT["degree",0.0174532925199433]],<br>        AXIS["geodetic longitude (Lon)",east,<br>            ORDER[2],<br>            ANGLEUNIT["degree",0.0174532925199433]],<br>    USAGE[<br>        SCOPE["Horizontal component of 3D system."],<br>        AREA["World."],<br>        BBOX[-90,-180,90,180]],<br>    ID["EPSG",4326]]<br>Data axis to CRS axis mapping: 2,1<br>Origin = (6.502501000000001,47.702059000000006)<br>Pixel Size = (0.005002000000000,-0.005002000000000)<br>Metadata:<br>  AREA_OR_POINT=Area<br>  TIFFTAG_SOFTWARE=ERDAS IMAGINE<br>Image Structure Metadata:<br>  COMPRESSION=PACKBITS<br>  INTERLEAVE=PIXEL<br>Corner Coordinates:<br>Upper Left  (   6.5025010,  47.7020590) (  6d30' 9.00"E, 47d42' 7.41"N)<br>Lower Left  (   6.5025010,  36.2974990) (  6d30' 9.00"E, 36d17'51.00"N)<br>Upper Right (  19.0075010,  47.7020590) ( 19d 0'27.00"E, 47d42' 7.41"N)<br>Lower Right (  19.0075010,  36.2974990) ( 19d 0'27.00"E, 36d17'51.00"N)<br>Center      (  12.7550010,  41.9997790) ( 12d45'18.00"E, 41d59'59.20"N)<br>Band 1 Block=512x512 Type=Float32, ColorInterp=Red<br>Band 2 Block=512x512 Type=Float32, ColorInterp=Green<br>Band 3 Block=512x512 Type=Float32, ColorInterp=Blue<br>Band 4 Block=512x512 Type=Float32, ColorInterp=Undefined<br></div><div dir="ltr"><br></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><span style="font-size:small">___________________</span><br></div><div dir="ltr"><span style="font-size:small"><br></span></div><div dir="ltr">Andrea Borruso<br>
website: <a href="https://medium.com/tantotanto" target="_blank">https://medium.com/tantotanto</a><br>38° 7' 48" N, 13° 21' 9" E, EPSG:4326<br><span style="font-size:small">___________________</span><br>
<br>
"cercare e saper riconoscere chi e cosa,<br>
 in mezzo all’inferno, non è inferno, <br>
e farlo durare, e dargli spazio"<br>
<br>
Italo Calvino<br></div></div></div></div></div></div></div></div></div></div></div></div></div></div>