<div dir="ltr">Hi <span style="font-size:12.8px;white-space:nowrap">Tumasgiu,</span><div><span style="font-size:12.8px;white-space:nowrap"><br></span></div><div><span style="font-size:12.8px;white-space:nowrap">I agree with you regarding the warning. How do I then set the SRID for the raster so that it is part of the metadata information?</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 11, 2017 at 1:31 PM, Tumasgiu Rossini <span dir="ltr"><<a href="mailto:rossini.t@gmail.com" target="_blank">rossini.t@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Maybe a warning showing up when using -s and -R options together could be a nice thing to do ?<br></div><div>Or maybe implementing another option which would use st_setsrid instead of st_transform.<br><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2017-04-11 14:25 GMT+02:00 Tumasgiu Rossini <span dir="ltr"><<a href="mailto:rossini.t@gmail.com" target="_blank">rossini.t@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hi,<br><br></div>I think I found the probelm, it is the -s option which make the sql<br></div><div>applying a st_transfrom on the raster to reproject it into the desired CRS<br></div><div>before inserting it in the table, thus creating an in-db raster.<br></div></div><div class="m_9153811903756267444HOEnZb"><div class="m_9153811903756267444h5"><div class="gmail_extra"><br><div class="gmail_quote">2017-04-11 12:14 GMT+02:00 Osahon Oduware <span dir="ltr"><<a href="mailto:osahon.gis@gmail.com" target="_blank">osahon.gis@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi Regina,</div><div><br></div><div>I would like to add that the SHOW command below returns "on": </div><div><br></div><div><pre class="m_9153811903756267444m_-2100610813396741032m_417160081739070732gmail-lang-sql m_9153811903756267444m_-2100610813396741032m_417160081739070732gmail-prettyprint m_9153811903756267444m_-2100610813396741032m_417160081739070732gmail-prettyprinted" style="margin-top:0px;margin-bottom:1em;padding:5px;border:0px;font-size:13px;width:auto;max-height:600px;overflow:auto;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;background-color:rgb(239,240,241);color:rgb(57,51,24);word-wrap:normal"><code style="margin:0px;padding:0px;border:0px;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;white-space:inherit"><span class="m_9153811903756267444m_-2100610813396741032m_417160081739070732gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">SHOW postgis</span><span class="m_9153811903756267444m_-2100610813396741032m_417160081739070732gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="m_9153811903756267444m_-2100610813396741032m_417160081739070732gmail-pln" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">enable_outdb_rasters</span><span class="m_9153811903756267444m_-2100610813396741032m_417160081739070732gmail-pun" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">;</span></code></pre></div><div>which I believe indicates that the environment variable is SET to enable out-db raster. However, the result from your 1st query shows that the raster table isn't created with out-db. Any reason for this behaviour?<br></div><div><br></div><br><div class="gmail_quote"><span>---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Osahon Oduware</b> <span dir="ltr"><<a href="mailto:osahon.gis@gmail.com" target="_blank">osahon.gis@gmail.com</a>></span><br>Date: Tue, Apr 11, 2017 at 10:07 AM<br>Subject: Re: [postgis-users] PostGIS Out-DB Raster Not Behaving As Expected<br></span><div><div class="m_9153811903756267444m_-2100610813396741032h5">To: PostGIS Users Discussion <<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><wbr>><br>Cc: Regina Obe <<a href="mailto:lr@pcorp.us" target="_blank">lr@pcorp.us</a>>, Jorge Gustavo Rocha <<a href="mailto:jgr@di.uminho.pt" target="_blank">jgr@di.uminho.pt</a>><br><br><br><div dir="ltr">Hi Regina,<div><br></div><div>I have tried the queries above. For the related raster table,</div><div><br></div><div><span style="font-size:12.8px">SELECT r_table_name, r_raster_column, out_db FROM raster_columns; RETURNS</span><br></div><div><div><span style="font-size:12.8px">"raster_table","rast","[False, False, False]"</span><br></div></div><div><span style="font-size:12.8px"><br></span></div><div><span class="m_9153811903756267444m_-2100610813396741032m_417160081739070732gmail-"><span style="font-size:12.8px">SELECT t.rid, (md).isoutdb, (md).path</span><br style="font-size:12.8px"><span style="font-size:12.8px">FROM nj_ned AS t, ST_BandMetaData(t.rast) AS md</span><br style="font-size:12.8px"></span><span style="font-size:12.8px">limit 1; RETURNS</span><span style="font-size:12.8px"><br></span></div><div><div><span style="font-size:12.8px">1,False,""</span></div></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">I believe from the result of the 1st query that out-db is not enabled. However, the environment variable POSTGIS_ENABLE_OUTDB_<wbr>RASTERS is SET to 1.<b> I have tried to also enable it with the following, restarted the postgres Service, and re-loaded the raster, but the 1st query gives the same result:</b></span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">ALTER DATABASE <database_name> SET postgis.enable_outdb_rasters TO True;</span><br></div><div><span style="font-size:12.8px"><br></span></div><div><br></div><div>Please, could you help me further on what I am not doing right to enable the out-db rasters.</div><div><div class="m_9153811903756267444m_-2100610813396741032m_417160081739070732gmail-h5"><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 10, 2017 at 8:31 PM, Regina Obe <span dir="ltr"><<a href="mailto:lr@pcorp.us" target="_blank">lr@pcorp.us</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">You should also check the following queries<br>
<br>
SELECT r_table_name, r_raster_column, out_db FROM raster_columns;<br>
<br>
Out_db should be true for all your bands for the specific table and as Jorge mentioned, you shouldn't see any over view tables (which start with o_..{table}.<br>
I believe QGIS internally tries to use over view tables to speed things up, so it's possible it's using an overview table instead of the main outdb table if you are zoomed out enough.<br>
<br>
For outdb, querying the meta data of the raster will tell you the path if it's an outdb.  Replace nj_ned with your table name.<br>
<br>
SELECT t.rid, (md).isoutdb, (md).path<br>
FROM nj_ned AS t, ST_BandMetaData(t.rast) AS md<br>
limit 1;<br>
<br>
Hope that helps,<br>
Regina<br>
<a href="http://postgis.us" rel="noreferrer" target="_blank">http://postgis.us</a><br>
<a href="http://postgis.net" rel="noreferrer" target="_blank">http://postgis.net</a><br>
<span><br>
<br>
-----Original Message-----<br>
From: postgis-users [mailto:<a href="mailto:postgis-users-bounces@lists.osgeo.org" target="_blank">postgis-users-bounces@<wbr>lists.osgeo.org</a>] On Behalf Of Jorge Gustavo Rocha<br>
Sent: Monday, April 10, 2017 2:14 PM<br>
To: <a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
Subject: Re: [postgis-users] PostGIS Out-DB Raster Not Behaving As Expected<br>
<br>
Hi,<br>
<br>
According to the documentation [1], if you add the option -l (like -l<br>
2,4,8,16 ), the overviews are created in the database, even if you use the -R option.<br>
<br>
But since you did not use the -l option, I don't know how you can see the images.<br>
<br>
Can you check the layer properties in QGIS? Are any pyramids available or not?<br>
<br>
Regards,<br>
<br>
Jorge<br>
<br>
<br>
</span><span> s 16:52 de 10-04-2017, Osahon Oduware escreveu:<br>
> Hi All,<br>
><br>
> I created an out-db raster using the following syntax:<br>
><br>
> raster2pgsql -s {srid} -c -R -I -C -F -t auto {absolute_file_path}<br>
> public.{table} | psql -h {host} -p {port} -d {database} -U {user}<br>
><br>
> The table was created successfully. I wanted to confirm that the<br>
> actual file is being read from the location in the filesystem by<br>
> performing the following steps:<br>
> 1) I moved the raster file to a different location.<br>
> 2) I opened QGIS and attempted to load the raster from PostGIS table.<br>
><br>
> I was surprised that QGIS could load the file. *How is this possible<br>
> when the actual raster data is not stored in the database table?*<br>
><br>
><br>
> ______________________________<wbr>_________________<br>
> postgis-users mailing list<br>
> <a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
> <a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailma<wbr>n/listinfo/postgis-users</a><br>
><br>
<br>
J. Gustavo<br>
--<br>
Jorge Gustavo Rocha<br>
</span>Departamento de Inform tica<br>
<span>Universidade do Minho<br>
4710-057 Braga<br>
Tel: <a href="tel:+351%20253%20604%20480" value="+351253604480" target="_blank">+351 253604480</a><br>
Fax: <a href="tel:+351%20253%20604%20471" value="+351253604471" target="_blank">+351 253604471</a><br>
</span>M vel: <a href="tel:+351%20910%20333%20888" value="+351910333888" target="_blank">+351 910333888</a><br>
<span class="m_9153811903756267444m_-2100610813396741032m_417160081739070732gmail-m_-2403125821986378161im m_9153811903756267444m_-2100610813396741032m_417160081739070732gmail-m_-2403125821986378161HOEnZb">skype: nabocudnosor<br>
______________________________<wbr>_________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailma<wbr>n/listinfo/postgis-users</a><br>
<br>
</span><div class="m_9153811903756267444m_-2100610813396741032m_417160081739070732gmail-m_-2403125821986378161HOEnZb"><div class="m_9153811903756267444m_-2100610813396741032m_417160081739070732gmail-m_-2403125821986378161h5">______________________________<wbr>_________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailma<wbr>n/listinfo/postgis-users</a></div></div></blockquote></div><br></div></div></div></div>
</div></div></div><br></div>
<br>______________________________<wbr>_________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailma<wbr>n/listinfo/postgis-users</a><br></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/postgis-users</a><br></blockquote></div><br></div>