Is there a way to get or generate a tile matrix set geometry grid in any format like shapefile, geopackage, postgis, ... ?
EDIT
I've tried to create a set of grid polygons with postgis to generate tile matrix set geometries similar to the following worldwind structure, i.e. 5 rows by 10 columns 36 degrees tiles at level 0 based on EPSG:4326 full extent with bottom-left orgin
https://www.microimages.com/documentation/TechGuides/78Worldwind.pdf
I've tried using ST_SquareGrid function like
CREATE TABLE worldwind_z0 AS
SELECT 0 AS zoom_level,
(ST_SquareGrid(36, ST_Transform(ST_GeomFromText('POLYGON((-180 -90,180 -90,180 90,-180 90,-180 -90))', 4326), 4326))).i AS col,
(ST_SquareGrid(36, ST_Transform(ST_GeomFromText('POLYGON((-180 -90,180 -90,180 90,-180 90,-180 -90))', 4326), 4326))).j AS row,
(ST_SquareGrid(36, ST_Transform(ST_GeomFromText('POLYGON((-180 -90,180 -90,180 90,-180 90,-180 -90))', 4326), 4326))).geom AS geom;
but the created grid origin is at the coord (0,0) for SRID 4326, and I would need the grid origin to be at the bottom left (-180,-90).
SOLUTION
For those interested I've used the ST_CreateFishnet function from this post
Creating regular polygon grid in PostGIS
modified as follows to start row & column numbering at 0
CREATE OR REPLACE FUNCTION ST_CreateFishnet(
nrow integer, ncol integer,
xsize float8, ysize float8,
x0 float8 DEFAULT 0, y0 float8 DEFAULT 0,
OUT "row" integer, OUT col integer,
OUT geom geometry)
RETURNS SETOF record AS
$$
SELECT i AS row, j AS col, ST_Translate(cell, j * $3 + $5, i * $4 + $6) AS geom
FROM generate_series(0, $1 - 1) AS i,
generate_series(0, $2 - 1) AS j,
(
SELECT ('POLYGON((0 0, 0 '||$4||', '||$3||' '||$4||', '||$3||' 0,0 0))')::geometry AS cell
) AS foo;
$$ LANGUAGE sql IMMUTABLE STRICT;
To get what I want I just have to use
SELECT * FROM ST_CreateFishnet(5, 10, 36, 36, -180, -90)