-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
-
Tile Serving with Dynamic Geometry
CREATE OR REPLACE FUNCTION tilehexagons(z integer, x integer, y integer, step integer, OUT geom geometry(Polygon, 3857), OUT i integer, OUT j integer) RETURNS SETOF record AS $$ DECLARE bounds geometry; maxbounds geometry := ST_TileEnvelope(0, 0, 0); edge float8; BEGIN bounds := ST_TileEnvelope(z, x, y); edge := (ST_XMax(bounds) - ST_XMin(bounds)) / pow(2, step); FOR geom, i, j IN SELECT ST_SetSRID(hexagon(h.i, h.j, edge), 3857), h.i, h.j FROM hexagoncoordinates(bounds, edge) h LOOP IF maxbounds ~ geom AND bounds && geom THEN RETURN NEXT; END IF; END LOOP; END; $$ LANGUAGE 'plpgsql' IMMUTABLE STRICT PARALLEL SAFE;
-
Waiting for PostGIS 3.1: Grid Generators · Paul Ramsey
SELECT (ST_HexagonGrid(100000, ST_Transform(a.geom, 3857))).* FROM admin a WHERE name = 'Germany';
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
No status

