I was reviewing this function in PostGis
https://postgis.net/docs/manual-dev/ST_HexagonGrid.html
1) What I don't understand is what the underlying geom data would be. What's the source to get the USA map as shown? What is the DB schema? I think it could be one record, if I only need the USA boundary, not each state?
2) Is the result a list of points? or geom vectors?
3) If geom vectors, how do you convert them into points of lat and lng?
4) How to do approximate the hexigons to approximate a 50 mile radius from a point?
UPDATE:
I played with the width to try to get the correct number of hexagons based on Jim Jones example below. Unfortunately, something went wrong..
1) the length seems to have no relation to meters
2) There are multiple sized hexagons, which seems weird.
postgis_test=# WITH j AS (
postgis_test(# SELECT ST_Transform((hex).geom,4326) AS hex FROM (
postgis_test(# SELECT
postgis_test(# generate_hexgrid(
postgis_test(# 5909968.8,
postgis_test(# ST_XMin(ST_Extent(ST_Transform(geom,3857))) ,
postgis_test(# ST_YMin(ST_Extent(ST_Transform(geom,3857))) ,
postgis_test(# ST_XMax(ST_Extent(ST_Transform(geom,3857))) ,
postgis_test(# ST_YMax(ST_Extent(ST_Transform(geom,3857))) ) AS hex
postgis_test(# FROM usa_states)i)
postgis_test-# SELECT count(j.hex) FROM j,usa_states
postgis_test-# WHERE ST_Intersects(usa_states.geom,j.hex);
count
-------
119
(1 row)
postgis_test=# WITH j AS (
postgis_test(# SELECT ST_Transform((hex).geom,4326) AS hex FROM (
postgis_test(# SELECT
postgis_test(# generate_hexgrid(
postgis_test(# 5909968.8,
postgis_test(# ST_XMin(ST_Extent(ST_Transform(geom,3857))) ,
postgis_test(# ST_YMin(ST_Extent(ST_Transform(geom,3857))) ,
postgis_test(# ST_XMax(ST_Extent(ST_Transform(geom,3857))) ,
postgis_test(# ST_YMax(ST_Extent(ST_Transform(geom,3857))) ) AS hex
postgis_test(# FROM usa_states)i)
postgis_test-# SELECT DISTINCT st_area(j.hex) FROM j,usa_states
postgis_test-# WHERE ST_Intersects(usa_states.geom,j.hex);
st_area
------------------
1219.78281686003
2089.11341619338
2089.11341619338
3379.93344444246
7051.4650344734
12076.9943663072
(6 rows)