developmentseed / tipg

Simple and Fast Geospatial OGC Features and Tiles API for PostGIS.
https://developmentseed.org/tipg/
MIT License
153 stars 23 forks source link

stateless tipg: remove `collection_catalog` #37

Open vincentsarago opened 1 year ago

vincentsarago commented 1 year ago

Since the start of tifeature/timvt/tipg, we designed the application with having a list of the available collections/layers stored in the application State: https://github.com/developmentseed/tipg/blob/489f0243b0b4f0d46d12f06a1baf0bccc1d4232a/tipg/db.py#L83

This gave some advantages:

The collection_catalog is created at application startup https://github.com/developmentseed/tipg/blob/489f0243b0b4f0d46d12f06a1baf0bccc1d4232a/tipg/main.py#L65-L80 because we assumed it's a pretty costly process.

The problem then (as explained in https://github.com/developmentseed/eoAPI/pull/55#issuecomment-1471006644) is when you have changed in the DB (e.g new table) it won't show up in the application because the catalog is now updated.

Proposal

cc @bitner

bitner commented 1 year ago

We will also need to take into account merging in the overrides that can come from environment variables.

I will note, that we can use the existing function right now to filter by collection by setting tables= and functions=.