[postgis-users] Cut extent box2d into small regular boxes, and iterate through each box of features

Lars Aksel Opsahl Lars.Opsahl at nibio.no
Sun Mar 27 23:49:22 PDT 2022



________________________________
>From: postgis-users <postgis-users-bounces at lists.osgeo.org> on behalf of Mike Taves <mwtoews at gmail.com>Sent: Sunday, March 27, 2022 10:31 PMTo: PostGIS Users Discussion <postgis-users at lists.osgeo.org>Subject: Re: [postgis-users] Cut extent box2d into small regular boxes, and iterate through each box of features
>
>On Sat, 26 Mar 2022 at 02:44, Shaozhong SHI <shishaozhong at gmail.com> wrote:
>> Is there a procedure to get a box2d for the extent of features?
>> Divide the box into smaller regular boxes
>> loop carry out geospatial operation in each box
>
>A few ideas to generate the small regular boxes, see:
>- https://postgis.net/docs/ST_SquareGrid.html
>- https://gis.stackexchange.com/q/16374/
>
Hi

We use a lot of grids, but we have seen that using content to influence each grid cell size is more important than having regular sized grid cell. For instance, smaller cell's where it's high density of polygons and larger cell in other areas. When grid cells are "equal" related to content (and not spatial size) it also easier to run thing parallel without running into memory problems and so on.

Here is some sample code https://github.com/larsop/content_balanced_grid
to create grids and here some code where we use such a grid https://github.com/larsop/find-overlap-and-gap .

Lars


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20220328/7821fbf3/attachment.html>


More information about the postgis-users mailing list