Skip to content

How to get geometry given a cell ID? #124

Answered by zachasme
bertday asked this question in Q&A
Discussion options

You must be logged in to vote

Hi again, Robert!

If you wish to fetch one geometry per cell, I would use h3_polygon_to_cells, for example:

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!

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bertday
Comment options

Answer selected by bertday
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #123 on March 08, 2023 12:39.