Re: [postgis-users] Spatially ordering data

2017-03-02 Thread Lars Aksel Opsahl
Hi Thanks for testing it. We have used it quite bit and have not seen any scaling problems yet. For a layer with 8 million polygons (about 1 billion points) it takes about one minute to create a content based grid. (Se example further down) We use the && operator to check intersection to

Re: [postgis-users] Spatially ordering data

2017-03-02 Thread Tim Keitt
http://www.keittlab.org/ On Wed, Mar 1, 2017 at 5:28 AM, Jonathan Moules < jonathan-li...@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

Re: [postgis-users] Spatially ordering data

2017-03-02 Thread Burgholzer, Robert (DEQ)
How about: 1. Take a centroid of each shape, 2. Rounding it’s x and y coordinates to whole lat/lon values 3. Ordering by lat_round, lon_round and these values would proceed in a gridded fashion. Ex: select oid, floor(st_x(the_geom)) as x_index, floor(st_y(the_geom)) as y_index from

Re: [postgis-users] Spatially ordering data

2017-03-02 Thread Jonathan Moules
Thanks for the suggestions. Some thoughts after testing: Darafei: (order by ST_Geohash) Interesting notion, but when implemented the grouping is tenuous at best. If I return 5,000 features they can be spread over 200km (bad) or 6km (good). It'd definitely better clustered than without this,