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
545 stars 68 forks source link

t-rex doesn't recognize the CRS/SRS #308

Closed GongFu666 closed 10 months ago

GongFu666 commented 10 months ago

Here is an example feature geometry from my database: { "type": "Polygon", "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:EPSG::4326" } }, "coordinates": [ [ ............. ] ] }

t-rex gives the following warning: Unknown SRS of geometry 'the_geom' - assuming SRID 3857. What can I do about it? Is it possible to set the SRS in the config.toml?

GongFu666 commented 10 months ago

Found the problem. I am using Prisma as ORM which does not support the PostGIS geometry type. In the prisma schema I had the following code to define the geometry on my model:

geometry Unsupported("geometry")

The correct code should look something like this:

geometry Unsupported("geometry(Geometry, 4326)")

Then everything works just fine.