<div dir="ltr"><br><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><a href="http://www.keittlab.org/" target="_blank">http://www.keittlab.org/</a></div></div></div>
<br><div class="gmail_quote">On Wed, Mar 1, 2017 at 5:28 AM, Jonathan Moules <span dir="ltr"><<a href="mailto:jonathan-lists@lightpear.com" target="_blank">jonathan-lists@lightpear.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u><div><div style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif">Hi List,<br>I've got a database of about 60 million spatial features that I need to run through a process.<br><br>The process can't do all of them at once, so I want to get the data from postgis in spatial chunks of up to say 500,000 features per query.<br></div></div></blockquote><div><br></div><div>Can you define "spatial chunks"? Its pretty hard to answer if this is not precise.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif"><br>The data itself isn't evenly spatially distributed, so gridding won't work either, and  I don't see any prospectively useful functions in the reference.<br><br>Non-spatially this would be simple:<br><br>    <i>SELECT * FROM my_table ORDER BY some_key ASC LIMIT 500000 OFFSET 0</i><br>    <br>Does anyone have any suggestions for how to spatially order data with PostGIS?<br></div></div></blockquote><div><br></div><div>If you want to limit the number of rows, declare a cursor (look up in postgres docs) with a maximum number of rows to return.</div><div><br></div><div>THK</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif"><br>Thanks,<br>Jonathan<br></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></div>