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

Lars Aksel Opsahl Lars.Opsahl at nibio.no
Mon Mar 28 03:08:37 PDT 2022


>From: postgis-users <postgis-users-bounces at lists.osgeo.org> on behalf of Shaozhong SHI <shishaozhong at gmail.com>Sent: Monday, March 28, 2022 11:42 AMTo: 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
>Hi, Lars,
>
>Would the following alternative work?
>
>In PostGIS, one can group by geometry.  Based on this information, can grid be generated?  so that grid with 0 features can be skipped.
>

Hi

In our cases this would not solve our problems, because grid cells with zero content does not cause any big performance issue problems, but we do not need them so it's nice to get reed of them.

But I think it's easier to have a complete grids coverage and instead vary cell size based on content. If you have a set of 10 mill polygons and and you make a grid so you can process them in parallel  what's important is that each job has about the same needs related to memory and CPU, and this can be done by setting for instance a max a value for number of features pr cell. (You can here also count number points in each polygon but that takes more time and you can not base the grid cell creation on indexes)

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


More information about the postgis-users mailing list