<p dir="ltr">What’s the difference between the two then ? And what is the fastest please ?</p>
<br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">Le ven. 14 mars 2025, 22:35, Brent Wood <<a href="mailto:Brent.Wood@niwa.co.nz">Brent.Wood@niwa.co.nz</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Postgis generated hexagons are NOT H3 hexagons - unless you very carefully generate them to fit.</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Use the Postgres h3 extension for h3 hexagon support:</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<a href="https://blog.rustprooflabs.com/2022/04/postgis-h3-intro" id="m_-3492070036404599191LPlnk" target="_blank" rel="noreferrer">https://blog.rustprooflabs.com/2022/04/postgis-h3-intro</a></div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div id="m_-3492070036404599191Signature" style="color:inherit">
<div style="margin-right:0px;margin-left:0px;font-family:Calibri,Arial,Helvetica,sans-serif">
Brent Wood<br>
<br>
Principal Technician, Fisheries<br>
NIWA<br>
DDI: +64 (4) 3860529</div>
</div>
<div id="m_-3492070036404599191appendonsend"></div>
<hr style="display:inline-block;width:98%">
<div id="m_-3492070036404599191divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Sylvain Ard <<a href="mailto:sylvain.ard@gmail.com" target="_blank" rel="noreferrer">sylvain.ard@gmail.com</a>><br>
<b>Sent:</b> Saturday, March 15, 2025 08:49<br>
<b>To:</b> Brent Wood <<a href="mailto:Brent.Wood@niwa.co.nz" target="_blank" rel="noreferrer">Brent.Wood@niwa.co.nz</a>><br>
<b>Cc:</b> <a href="mailto:qgis-user@lists.osgeo.org" target="_blank" rel="noreferrer">qgis-user@lists.osgeo.org</a> <<a href="mailto:qgis-user@lists.osgeo.org" target="_blank" rel="noreferrer">qgis-user@lists.osgeo.org</a>><br>
<b>Subject:</b> Re: [Qgis-user] question</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div>yes but H3 can't simplify the job ?</div>
<div>
<div dir="ltr" data-smartmail="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div>
<div>
<div>Sylvain Ard<br>
0549507724<br>
0778380991</div>
<div><a href="mailto:sylvain.ard@gmail.com" target="_blank" rel="noreferrer">sylvain.ard@gmail.com</a></div>
<div><a href="http://sylvain-ard.fr/" target="_blank" rel="noreferrer">https://www.sylvain-ard.fr</a><br>
</div>
Entreprise individuelle SIRET : 80079243400022<br>
</div>
Appt 26 Bât A Résidence Le Patio<br>
</div>
83 rue de la Bugellerie<br>
</div>
86000 Poitiers<br>
</div>
</div>
</div>
</div>
</div>
<br>
</div>
<br>
<div>
<div dir="ltr">Le ven. 14 mars 2025 à 20:48, Brent Wood <<a href="mailto:Brent.Wood@niwa.co.nz" target="_blank" rel="noreferrer">Brent.Wood@niwa.co.nz</a>> a écrit :<br>
</div>
<blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div dir="ltr">
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Hi,</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Off the top of my head...</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Postgis can easily cope with millions of records. Given the points are there, use that to create the hexagons as required - this can be done using
<a href="https://postgis.net/docs/ST_HexagonGrid.html" id="m_-3492070036404599191x_m_4221934677744483969LPlnk" target="_blank" rel="noreferrer">
https://postgis.net/docs/ST_HexagonGrid.html</a></div>
<div><br>
</div>
<div>If you set up your QGIS project with preset zoom levels, and create a set of appropriately sized hexagons for each zoom level, then populate a column with the number of points it contains.</div>
<div><br>
</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
There will be some devilish details - as you zoom in, the polygon's real area will get smaller, so will contain less points. A fixed symbology will therefore change the colour range with the scale.</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Calculating a normalised value, perhaps something like instead of the no of points, you calculate a normalised value - the hex at each scale with the most points gets 100, the rest get a value based on the no of points/the max for that scale, so all polygon
datasets will have colours set to values between 0 and 100. All doable with SQL.</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Do all the data stuff in Postgis, then just plot in QGIS.</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
There are various ways to set QGIS up for this, but one reasonably straightforward way that should work is having a separate hexagon layer for each scale, with a scale limit on displaying it so that all map scales are represented by one of the hexagon layers,
with the fixed zoom levels/scales, set the same symbology for each layer, then group them into a single group.</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Something to consider anyway...</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Cheers</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div id="m_-3492070036404599191x_m_4221934677744483969Signature" style="color:inherit">
<div style="margin-right:0px;margin-left:0px;font-family:Calibri,Arial,Helvetica,sans-serif">
Brent Wood<br>
<br>
Principal Technician, Fisheries<br>
NIWA<br>
DDI: +64 (4) 3860529</div>
</div>
<div id="m_-3492070036404599191x_m_4221934677744483969appendonsend"></div>
<hr style="display:inline-block;width:98%">
<div id="m_-3492070036404599191x_m_4221934677744483969divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> QGIS-User <<a href="mailto:qgis-user-bounces@lists.osgeo.org" target="_blank" rel="noreferrer">qgis-user-bounces@lists.osgeo.org</a>>
on behalf of Sylvain Ard via QGIS-User <<a href="mailto:qgis-user@lists.osgeo.org" target="_blank" rel="noreferrer">qgis-user@lists.osgeo.org</a>><br>
<b>Sent:</b> Friday, March 14, 2025 23:35<br>
<b>To:</b> <a href="mailto:qgis-user@lists.osgeo.org" target="_blank" rel="noreferrer">qgis-user@lists.osgeo.org</a> <<a href="mailto:qgis-user@lists.osgeo.org" target="_blank" rel="noreferrer">qgis-user@lists.osgeo.org</a>><br>
<b>Subject:</b> [Qgis-user] question</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div>Hello,<br>
I'd like a map with hexagons that are darker the more points there are underneath. My points are in a PostgreSQL table. If there are no points, there should be no hexagon. The hexagons have a constant size on the screen, so they have to be recalculated each
time the map is zoomed in. I want a truly optimized solution because I have millions of points. So, perhaps I could use QGIS-server.<br>
Please suggest a solution for both the server and client side.<br>
Best regards</div>
<div>PS : my map must be like GBIF maps</div>
<div><br>
</div>
<div>
<div dir="ltr">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div>
<div>
<div>Sylvain Ard<br>
0549507724<br>
0778380991</div>
<div><a href="mailto:sylvain.ard@gmail.com" target="_blank" rel="noreferrer">sylvain.ard@gmail.com</a></div>
<div><a href="http://sylvain-ard.fr/" target="_blank" rel="noreferrer">https://www.sylvain-ard.fr</a><br>
</div>
Entreprise individuelle SIRET : 80079243400022<br>
</div>
Appt 26 Bât A Résidence Le Patio<br>
</div>
83 rue de la Bugellerie<br>
</div>
86000 Poitiers<br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<table cellspacing="20" style="width:600px;font-size:8pt;font-family:Arial">
<tbody>
<tr>
<td><a href="https://www.niwa.co.nz/" target="_blank" rel="noreferrer"><img src="https://www.niwa.co.nz/static/niwa-2018-horizontal-180.png">
</a></td>
<td>
<table style="width:500px">
<tbody>
<tr>
<td><span>Brent Wood <br>
<font color="#1793d2">Principal Technician - GIS and Spatial Data Management</font><br>
<font color="#1793d2">Programme Leader - Environmental Information Delivery</font><br>
+64-4-386-0529<br>
<br>
National Institute of Water & Atmospheric Research Ltd (NIWA)<br>
301 Evans Bay Parade Hataitai Wellington New Zealand<br>
<b>Connect with NIWA:</b> <a href="https://www.niwa.co.nz/" target="_blank" rel="noreferrer">niwa.co.nz</a>
<a href="https://www.facebook.com/nzniwa" target="_blank" rel="noreferrer">
Facebook</a> <a href="https://www.linkedin.com/company/niwa" target="_blank" rel="noreferrer">
LinkedIn</a> <a href="https://twitter.com/niwa_nz" target="_blank" rel="noreferrer">
Twitter</a> <a href="https://www.instagram.com/niwa_science" target="_blank" rel="noreferrer">
Instagram</a> <a href="https://www.youtube.com/channel/UCJ-j3MLMg1H59Ak2UaNLL3A" target="_blank" rel="noreferrer">
YouTube</a> </span></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<font face="Arial" size="1">To ensure compliance with legal requirements and to maintain cyber security standards, NIWA's IT systems are subject to ongoing monitoring, activity logging and auditing. This monitoring and auditing service may be provided by third
parties. Such third parties can access information transmitted to, processed by and stored on NIWA's IT systems.
<br>
Note: This email is intended solely for the use of the addressee and may contain information that is confidential or subject to legal professional privilege. If you receive this email in error please immediately notify the sender and delete the email.
</font></div>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote></div>