|
Hello, again! I'm trying to get all hexagon IDs and geometries to cover a polygon at a given resolution. My query to get the IDs looks like: select
h3_polygon_to_cells(
st_setsrid(st_extent(geom), 4326),
8
) as id
from boundaryand that's working great! Now I just need to get the geometry for each hexagon. I'm having some trouble finding the right function. I've been trying Is there anyone who might be able to give me a pointer on this? Thanks so much! |
Answered by
zachasme
Mar 8, 2023
Replies: 1 comment 1 reply
|
Hi again, Robert! If you wish to fetch one geometry per cell, I would use WITH cells AS (
SELECT
h3_polygon_to_cells(
st_setsrid(st_extent(geom), 4326),
8
) AS id
FROM boundary
) SELECT id, h3_cell_to_boundary_geometry(id) FROM cells;Cheers! |
1 reply
Answer selected by
rmx90210
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi again, Robert!
If you wish to fetch one geometry per cell, I would use
h3_polygon_to_cells, for example:Cheers!