<div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace">hey,<br></div><div class="gmail_default" style="font-family:monospace,monospace">the most classical approach would be to construct a <a href="https://en.wikipedia.org/wiki/Quadtree">quad tree</a>.<br></div><div class="gmail_default" style="font-family:monospace,monospace">You can think of it as a grid that adapts its resolution locally according to the data.<br></div><div class="gmail_default" style="font-family:monospace,monospace">This is also easy to code.<br></div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">Cheers,<br></div><div class="gmail_default" style="font-family:monospace,monospace">Rémi-C<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-03-01 12:46 GMT+01:00 Darafei "Komяpa" Praliaskouski <span dir="ltr"><<a href="mailto:me@komzpa.net" target="_blank">me@komzpa.net</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Have a look here:<br><br><a href="http://www.paulnorman.ca/blog/2016/05/improve-your-st-geohash-sorting-with-these-three-simple-tricks/" target="_blank">http://www.paulnorman.ca/blog/<wbr>2016/05/improve-your-st-<wbr>geohash-sorting-with-these-<wbr>three-simple-tricks/</a> <br><br>for simplest case, you can just order by your geom field.</div><br><div class="gmail_quote"><div dir="ltr">ср, 1 мар. 2017 г. в 14:44, Jonathan Moules <<a href="mailto:jonathan-lists@lightpear.com" target="_blank">jonathan-lists@lightpear.com</a>><wbr>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><u class="m_1092944026455885632gmail_msg"></u><div class="m_1092944026455885632gmail_msg"><div style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif" class="m_1092944026455885632gmail_msg">Hi List,<br class="m_1092944026455885632gmail_msg">I've got a database of about 60 million spatial features that I need to run through a process.<br class="m_1092944026455885632gmail_msg"><br class="m_1092944026455885632gmail_msg">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 class="m_1092944026455885632gmail_msg"><br class="m_1092944026455885632gmail_msg">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 class="m_1092944026455885632gmail_msg"><br class="m_1092944026455885632gmail_msg">Non-spatially this would be simple:<br class="m_1092944026455885632gmail_msg"><br class="m_1092944026455885632gmail_msg">    <i class="m_1092944026455885632gmail_msg">SELECT * FROM my_table ORDER BY some_key ASC LIMIT 500000 OFFSET 0</i><br class="m_1092944026455885632gmail_msg">    <br class="m_1092944026455885632gmail_msg">Does anyone have any suggestions for how to spatially order data with PostGIS?<br class="m_1092944026455885632gmail_msg"><br class="m_1092944026455885632gmail_msg">Thanks,<br class="m_1092944026455885632gmail_msg">Jonathan<br class="m_1092944026455885632gmail_msg"></div></div></div></div>______________________________<wbr>_________________<br class="m_1092944026455885632gmail_msg">
postgis-users mailing list<br class="m_1092944026455885632gmail_msg">
<a href="mailto:postgis-users@lists.osgeo.org" class="m_1092944026455885632gmail_msg" target="_blank">postgis-users@lists.osgeo.org</a><br class="m_1092944026455885632gmail_msg">
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" class="m_1092944026455885632gmail_msg" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/postgis-users</a></blockquote></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>