go-spatial / tegola

Tegola is a Mapbox Vector Tile server written in Go
http://tegola.io/
MIT License
1.26k stars 193 forks source link

[feature request] alternative geometry columns #828

Closed rohitmusti closed 2 years ago

rohitmusti commented 2 years ago

Huge thank you for making such a wonderful tool! It has been an excellent for projects I have been working on (including tree equity score).

Request: to be able to assign the geometry column used in the config.toml file. At the moment, the column needs to be set as geom and I often use multiple geometries when developing and it would be nice to be able to switch between these different geometries (i.e. geom1, geom2) without modifying my database and instead just updating the config.toml file

iwpnd commented 2 years ago

Hey @rohitmusti, you can do that already in the provider layers.

[[providers.layers]]
name = "landuse"
geometry_field = "foo"
sql = "SELECT gid, ST_AsBinary(foo) AS foo FROM gis.rivers WHERE geom && !BBOX!"

should suffice. Does also work when the provider is mvt_postgis.

rohitmusti commented 2 years ago

Thank you, I can't believe I missed that.!

ARolek commented 2 years ago

@rohitmusti Tree equity score looks like a great project and it's great to hear that tegola can be part of it.