[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgis-users
Subject:    Re: [postgis-users] How to SELECT one day's scene (Landsat 8 scenes)
From:       Jackie Nguyen <justaniceguy.nguyen () gmail ! com>
Date:       2014-03-19 10:01:42
Message-ID: CAD80O0uV2DHpf373N93LtJLn1m9T7AUUTJ_dAuZUDTttfZWcig () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi Resmi-C,
We have a new cover each 16-day from Landsat 8. But I only want one cover
in result of my query. I had add new column 'date_of_data' to store date of
a raster. And I think range could solve my problem.
Thank you!


On Wed, Mar 19, 2014 at 4:16 PM, Rémi Cura <remi.cura@gmail.com> wrote:

> It is a little bit hard to understand what you mean..
> As a summary :
> _you have lot's of rasters.
> _Each one as a position (and a date associated?).
>
> You need to get a raster based on its position (where st_intersects(..))),
> but it is not sufficient and you would like too also filter by date.
>
> You can do so easily by adding a condition  in the WHERE, like
> AND my_date < .... AND my_date > ...
> (or using time_range
> http://www.postgresql.org/docs/9.2/static/rangetypes.html , if postgres
> version >= 9.2)
>
> Now about making a table per day, it is entirely another question.
> logically wise, you could get the strict equivalent by adding a column on
> your raster table with the day of acquisition (the real date would be
> better).
>
> Now deciding to split or not your big raster table into several smaller is
> more about performance, and should be carefully designed (
> http://www.postgresql.org/docs/9.3/static/ddl-partitioning.html), based
> on row number, index size, your memory size, how the table will grow, what
> kind of usage you make of it, and so on.
>
>
> Cheers,
> Rémi-C
>
>
>
> 2014-03-19 8:28 GMT+01:00 Jackie Nguyen <justaniceguy.nguyen@gmail.com>:
>
>> Hi PostGIS Users,
>>
>> I have a huge dataset of raster in PostGIS. Each scene is divided into
>> tiles (tile-size 500x500). I was trying to SELECT rast FROM landsat8
>> WHERE ST_Intersects(rast, polygon). It runs very slow, because it
>> returns longitudinal scenes of raster. Where I just want one day's scene.
>> But the problem is if I query with fixed date, adjacent scene with
>> different date won't be selected. That's not true.
>> So I think about some solutions:
>>
>>    - Because Landsat 8 re-visiting every 16 days, so I will insert every
>>    16 days into different table. So I can query from raster that cover all the
>>    earth without duplicate.
>>    - I'm not sure about ST_Within(), ST_DWithin() then SELECT rast that
>>    doesn't overlap other >50%
>>
>> What would you do in this situation?
>>
>> --
>> ----
>> Jackie
>>
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users@lists.osgeo.org
>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users@lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>



-- 
----
Jackie

[Attachment #5 (text/html)]

<div dir="ltr">Hi Resmi-C,<div>We have a new cover each 16-day from Landsat 8. But I \
only want one cover in result of my query. I had add new column \
&#39;date_of_data&#39; to store date of a raster. And I think range could solve my \
problem.</div> <div>Thank you!</div></div><div class="gmail_extra"><br><br><div \
class="gmail_quote">On Wed, Mar 19, 2014 at 4:16 PM, Rémi Cura <span dir="ltr">&lt;<a \
href="mailto:remi.cura@gmail.com" target="_blank">remi.cura@gmail.com</a>&gt;</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><div><div><div><div><div><div><div><div><div>It is a little bit hard \
to understand what you mean..<br> </div>As a summary :<br></div>_you have lot&#39;s \
of rasters. <br>_Each one as a position (and a date associated?).<br> <br></div>You \
need to get a raster based on its position (where st_intersects(..))),<br></div>but \
it is not sufficient and you would like too also filter by date.<br><br></div>You can \
do so easily by adding a condition  in the WHERE, like <br>

</div>AND my_date &lt; .... AND my_date &gt; ... <br></div>(or using time_range <a \
href="http://www.postgresql.org/docs/9.2/static/rangetypes.html" \
target="_blank">http://www.postgresql.org/docs/9.2/static/rangetypes.html</a> , if \
postgres version &gt;= 9.2)<br>

<br></div>Now about making a table per day, it is entirely another question. \
logically wise, you could get the strict equivalent by adding a column on your raster \
table with the day of acquisition (the real date would be better).<br>

<br></div>Now deciding to split or not your big raster table into several smaller is \
more about performance, and should be carefully designed (<a \
href="http://www.postgresql.org/docs/9.3/static/ddl-partitioning.html" \
target="_blank">http://www.postgresql.org/docs/9.3/static/ddl-partitioning.html</a>), \
based on row number, index size, your memory size, how the table will grow, what kind \
of usage you make of it, and so on.<br>

<br><br></div>Cheers,<br>Rémi-C<br><div><div><div><div><div><div><div><div><br></div></div></div></div></div></div></div></div></div><div \
class="gmail_extra"><br><br><div class="gmail_quote">2014-03-19 8:28 GMT+01:00 Jackie \
Nguyen <span dir="ltr">&lt;<a href="mailto:justaniceguy.nguyen@gmail.com" \
target="_blank">justaniceguy.nguyen@gmail.com</a>&gt;</span>:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><p style="margin:0px 0px \
1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;color:rgb(51,51,51);font-family:&#39;Helvetica \
Neue&#39;,Helvetica,Arial,sans-serif;line-height:18px;background-color:rgba(248,248,248,0.6)">



Hi PostGIS Users,</p><p style="margin:0px 0px \
1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;color:rgb(51,51,51);font-family:&#39;Helvetica \
Neue&#39;,Helvetica,Arial,sans-serif;line-height:18px;background-color:rgba(248,248,248,0.6)">



I have a huge dataset of raster in PostGIS. Each scene is divided into tiles \
(tile-size 500x500). I was trying to <code style="margin:0px;padding:1px \
5px;border:0px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,&#39;Lucida \
Console&#39;,&#39;Liberation Mono&#39;,&#39;DejaVu Sans Mono&#39;,&#39;Bitstream Vera \
Sans Mono&#39;,&#39;Courier \
New&#39;,monospace,serif;color:rgb(34,34,34);background-color:rgb(238,238,238);white-space:pre-wrap">SELECT \
rast FROM landsat8 WHERE ST_Intersects(rast, polygon)</code>. It runs very slow, \
because it returns longitudinal scenes of raster. Where I just want one day&#39;s \
scene.<br>


But the problem is if I query with fixed date, adjacent scene with different date \
won&#39;t be selected. That&#39;s not true.<br>So I think about some \
solutions:</p><ul style="margin:0px 0px 1em \
30px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;list-style-position:initial;color:rgb(51,51,51);font-family:&#39;Helvetica \
Neue&#39;,Helvetica,Arial,sans-serif;line-height:18px;background-color:rgba(248,248,248,0.6)">



<li style="margin:0px 0px \
7px;padding:0px;border:0px;vertical-align:baseline;line-height:16px;word-wrap:break-word">Because \
Landsat 8 re-visiting every 16 days, so I will insert every 16 days into different \
table. So I can query from raster that cover all the earth without duplicate.</li>


<li style="margin:0px 0px \
7px;padding:0px;border:0px;vertical-align:baseline;line-height:16px;word-wrap:break-word">I&#39;m \
not sure about ST_Within(), ST_DWithin() then SELECT rast that doesn&#39;t overlap \
other &gt;50%</li>


</ul><p style="margin:0px 0px \
1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;color:rgb(51,51,51);font-family:&#39;Helvetica \
Neue&#39;,Helvetica,Arial,sans-serif;line-height:18px;background-color:rgba(248,248,248,0.6)">



What would you do in this situation?</p><span><font color="#888888"><div><br></div>-- \
<br>----<br>Jackie<br> </font></span></div>
<br></div></div>_______________________________________________<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="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" \
target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br></blockquote></div><br></div>
 <br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" \
target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br></blockquote></div><br><br \
clear="all"><div><br></div>-- <br>----<br> Jackie<br>
</div>



_______________________________________________
postgis-users mailing list
postgis-users@lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic