-
|
I am using Martin, Docker In the config: Now I like to generate a single MBTiles file with multiple Layers, where Layers are those same PostGIS Functions. but I cannot figure out how to include multiple layers. My Should I generate an MBTiles file for each layer and then merge e.g.? Something I can do in the config? A UNION Function? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
SELECT STRING_AGG(mvtl, '' ORDER BY layer_ord) AS mvt
FROM (
SELECT 0 AS layer_ord,
COALESCE(ST_AsMvt(t, 'landcover', /* ... */ ORDER BY id), '') AS mvtl
FROM (SELECT l.id
, ST_AsMvtGeom(l.geom, z, x, y) AS geom
...
FROM landcover_source l
WHERE ...
) t
UNION ALL
SELECT 1 AS layer_ord,
COALESCE(ST_AsMvt(t, 'place', /* ... */ ORDER BY id), '') AS mvtl
FROM (SELECT l.id
, ST_AsMvtGeom(l.geom, z, x, y) AS geom
...
FROM place_source l
WHERE ...
) t
);
|
Beta Was this translation helpful? Give feedback.
--source landcover,place(I haven't personally tried it, but all the functionality is there to support it i think)STRING_AGGto join the layers. Note theORDER BYin a few places - to ensure the layer and feature ordering inside the tile is always predictable