<div dir="ltr">Hi, Lars,<div><br></div><div>Would the following alternative work?</div><div><br></div><div>In PostGIS, one can group by geometry.  Based on this information, can grid be generated?  so that grid with 0 features can be skipped.</div><div><br></div><div>Regards,</div><div><br></div><div>David</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 28 Mar 2022 at 10:02, Lars Aksel Opsahl <<a href="mailto:Lars.Opsahl@nibio.no">Lars.Opsahl@nibio.no</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




<div dir="ltr">
>From: postgis-users <<a href="mailto:postgis-users-bounces@lists.osgeo.org" target="_blank">postgis-users-bounces@lists.osgeo.org</a>> on behalf of Shaozhong SHI <<a href="mailto:shishaozhong@gmail.com" target="_blank">shishaozhong@gmail.com</a>>Sent: Monday, March 28, 2022 10:25 AMTo: PostGIS Users Discussion <<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a>>Subject: Re: [postgis-users] Cut extent box2d into
 small regular boxes, and iterate through each box of features
<div>> </div>
<div>>Hi, Lars,</div>
<div>></div>
<div>>No explanation on content-balanced_grid can be found.  What is it based on?  What does content mean in this context?  Why do so?</div>
<div>></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Hi</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
There is some info in the readme file <a href="https://github.com/larsop/content_balanced_grid#readme" id="gmail-m_-7270696019732367100LPNoLPOWALinkPreview" target="_blank">
https://github.com/larsop/content_balanced_grid#readme</a> and here I also refer to<br>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
" For a exaample of usage look at page 18-23 at <a href="http://www.slideshare.net/laopsahl/foss4-g-topologyjuly162015" rel="nofollow" target="_blank">
http://www.slideshare.net/laopsahl/foss4-g-topologyjuly162015</a>
<p dir="auto"></p>
"<br>
</div>
<div></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
The idea very simple the higher density of polygons/features in a area the smaller will the grid cells be. When running it you have parameter for how many feature that should be max in each grid cell. Content is polygons/features.<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<span style="font-size:12pt">The code is also quite simple and the main function is here
<a href="https://github.com/larsop/content_balanced_grid/blob/master/func_grid/functions_def_02_content_based_balanced_grid.sql" target="_blank">
https://github.com/larsop/content_balanced_grid/blob/master/func_grid/functions_def_02_content_based_balanced_grid.sql</a> .</span><br>
<span style="font-size:12pt"></span><br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
The code in github is used quite often in NIBIO, but this code not like Postgis code that works in almost any case. NIBIO is basically developing code to solve problems we have and when does are solved we start to solve other problems, but we put the code out
 in case other may need it and make easy for other to help use to fix errors.<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Lars<br>
</div>
</div>

_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">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/mailman/listinfo/postgis-users</a><br>
</blockquote></div>