t-rex-tileserver / t-rex

t-rex is a vector tile server specialized on publishing MVT tiles from your own data
https://t-rex.tileserver.ch/
MIT License
556 stars 69 forks source link

How to configure t-rex to use a database function with PostGIS ST_AsMVT #287

Closed pantierra closed 2 years ago

pantierra commented 2 years ago

Many thanks for this great piece of software!

May I ask for a bit of guidance on how to configure t-rex to serve vector tiles that are being directly generated by PostGIS using ST_AsMVT? I wasn't able to find any hints in the documentation.

Given a postgres function that does some magic:

CREATE OR REPLACE FUNCTION my_special_tiles(
    z INTEGER, x INTEGER, y INTEGER
)
RETURNS BYTEA AS
$$
    BEGIN
        ....
        RETURN ST_AsMVT(...);
    END;
$$
LANGUAGE plpgsql STABLE PARALLEL SAFE;

Is it possible to make t-rex serve this directly?

pka commented 2 years ago

It is currently not supported to merge raw MVTs from other sources like ST_AsMVT. If you need this now, then you can use one of the MVT servers out there, which are mainly based on ST_AsMVT.

pantierra commented 2 years ago

Thanks, @pka. It is a pitty, as I love using t-rex for the other layers. But sure, will rely on pg_tileserv (or others).