[postgis-users] Spatially ordering data

Tim Keitt tkeitt at utexas.edu
Thu Mar 2 11:57:49 PST 2017


On Wed, Mar 1, 2017 at 5:28 AM, Jonathan Moules <
jonathan-lists at lightpear.com> wrote:

> Hi List,
> I've got a database of about 60 million spatial features that I need to
> run through a process.
> 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.

Can you define "spatial chunks"? Its pretty hard to answer if this is not

> 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.
> Non-spatially this would be simple:
>     *SELECT * FROM my_table ORDER BY some_key ASC LIMIT 500000 OFFSET 0*
> Does anyone have any suggestions for how to spatially order data with
> PostGIS?

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.


> Thanks,
> Jonathan
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20170302/15aad046/attachment.html>

More information about the postgis-users mailing list