Skip to content

+ multi-res pt density lyr: H3 hexagons, pt vector tiles #29

@bbest

Description

@bbest
  • 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;

    see animation of zoom in/out
    image

  • 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions