<div dir="ltr"><div class="gmail_quote">Could anyone help with the questions below?</div><div class="gmail_quote"><br></div><div class="gmail_quote">---------- 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: Thu, May 11, 2017 at 11:00 AM<br>Subject: Re: [postgis-users] PostGIS Rasters Overview Factor<br>To: PostGIS Users Discussion <<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><wbr>><br>Cc: David Haynes <<a href="mailto:haynesd2@gmail.com" target="_blank">haynesd2@gmail.com</a>>, Regina Obe <<a href="mailto:lr@pcorp.us" target="_blank">lr@pcorp.us</a>>, Pierre Racine <<a href="mailto:pierre.racine@sbf.ulaval.ca" target="_blank">pierre.racine@sbf.ulaval.ca</a>><br><br><br><div dir="ltr">Hi David,<div><br></div><div>Thanks for your response. Sorry, I forgot to mention that I also performed the loading using the tile flag <b>-t 250x250</b> using the syntax below:</div><span><div><br></div><div><span style="color:rgb(80,0,80);font-size:12.8px">raster2pgsql -s <SRID> -d -Y -e -I -C -F -M -l 2,4,8,16,32,64,128,256,512,102</span><span style="color:rgb(80,0,80);font-size:12.8px"><wbr>4,2048,4096,8192,16384,32768,</span><span style="color:rgb(80,0,80);font-size:12.8px">6<wbr>5536 /path/to/raster/file </span></div></span><div><span style="color:rgb(80,0,80);font-size:12.8px">-t 250x250 <table_name> | psql -h <host_address> -U postgres -p 5432 -d <database></span><br></div><div><br></div><div>I obtained the quoted information below from this link:</div><div><a href="http://postgis.net/docs/manual-2.2/using_raster_dataman.html#RT_Raster_Overviews" target="_blank">http://postgis.net/docs/manual<wbr>-2.2/using_raster_dataman.html<wbr>#RT_Raster_Overviews</a><br></div><div><br></div><div>"overview_factor - this is the pyramid level of the overview table. The higher the number the lower the resolution of the table. raster2pgsql if given a folder of images, will compute overview of each image file and load separately. Level 1 is assumed and always the original file. Level 2 is will have each tile represent 4 of the original. So for example if you have a folder of 5000x5000 pixel image files that you chose to chunk 125x125, for each image file your base table will have (5000*5000)/(125*125) records = 1600, your (l=2) o_2 table will have ceiling(1600/Power(2,2)) = 400 rows,<b> your (l=3) o_3 will have ceiling(1600/Power(2,3) ) = 200 rows</b>. If your pixels aren't divisible by the size of your tiles, you'll get some scrap tiles (tiles not completely filled). Note that each overview tile generated by raster2pgsql has the same number of pixels as its parent, but is of a lower resolution where each pixel of it represents (Power(2,overview_factor) pixels of the original)."</div><div><br></div><div><b>Question 1</b></div><div>The example given in the document above states that "<b>... </b>your (l=2) o_2 table will have ceiling(1600/Power(2,2)) = 400 rows,<b> your (l=3) o_3 will have ceiling(1600/Power(2,3) ) = 200 rows ...." </b>It appears the <b>Power </b>function is being used internally to compute the number of rows for the overview table based on the overview_factor i.e. Power(2,<overview_factor>). If this is the case, <b>does it imply that the factors could be numbers other than power of 2 (e.g. 3 in this case), but cannot be greater than 1,000 ?</b></div><div><b><br></b></div><div><b>Question 2</b></div><div>After doing a bulk loading of <b>650 raster source files</b> with a tiling option flag, <b>-t 250x250</b>, and overview option flag, <span style="color:rgb(80,0,80);font-size:12.8px"><b>-l 2,4,8,16,32,64,128,256</b></span> my raster table had <b>1,040,000 rows</b> and the highest factor overview table, o_256_<table_name>, had <b>650 rows, </b>while the lowest factor table, o_2_<table_name>, had <b>260,000 rows.</b></div><div>Going by the example given in the document above, I would expect the opposite of what I am getting i.e. the highest factor overview table with more records (rows) than the lowest factor overview table. <b>What could be responsible for this?</b></div><div><br></div><div><b>Question 3</b></div><div>The document above states that "... If your pixels aren't divisible by the size of your tiles, you'll get some scrap tiles (tiles not completely filled) ...."</div><div>When I viewed the raster on QGIS (<b>see attached images</b>), I discovered that I get black portions on a large portion of the image when completely zoomed out. I only get to see the raster image when I zoom-in sufficiently (even for black portions).</div><div><b>What could be responsible for this black portions (see attached images) as my pixels are obviously divisible by the tile size (250x250)?</b></div><div><b><br></b></div><div>I would be glad if someone could help out with the above questions.</div><div><br></div><div><br></div><div><br></div></div><div class="m_7690755794646992848m_5670332867770189976HOEnZb"><div class="m_7690755794646992848m_5670332867770189976h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 10, 2017 at 5:12 PM, David Haynes <span dir="ltr"><<a href="mailto:haynesd2@gmail.com" target="_blank">haynesd2@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">You are correct overviews are powers based. Also it does not look like you specified tile size in your raster2pgsql statement<div><br></div><div><br></div><div><span style="color:rgb(0,0,0);font-size:12.8px">raster2pgsql -s <SRID> -d -Y -e -I -C -F -M -t <pixels> x <pixels> -l 2,4,8,16,32</span><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_7690755794646992848m_5670332867770189976m_-708536315752145613h5">On Wed, May 10, 2017 at 11:04 AM, Osahon Oduware <span dir="ltr"><<a href="mailto:osahon.gis@gmail.com" target="_blank">osahon.gis@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_7690755794646992848m_5670332867770189976m_-708536315752145613h5"><div dir="ltr"><div>Hi All,</div><div><br></div><div>I tried loading a raster with overviews using the raster2pgsql tool using the syntax below:</div><div><br></div><div>raster2pgsql -s <SRID> -d -Y -e -I -C -F -M -l 2,4,8,16,32,64,128,256,512,102<wbr>4,2048,4096,8192,16384,32768,6<wbr>5536 /path/to/raster/file <table_name> | psql -h <host_address> -U postgres -p 5432 -d <database></div><div><br></div><div>but it gave an error message stating that the overview factor cannot be more than 1,000.</div><div><br></div><div>I would like to know how the Overview-factor works. Must the value for the Overview-factor be in Powers of 2 (i.e. 2,4,8,16,...)?</div><div><br></div><div>I would be glad if someone could help my understanding.</div></div>
<br></div></div>______________________________<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>
<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></div><br></div>