Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using multiple mbtiles #38

Open
chpicone opened this issue Nov 25, 2021 · 0 comments
Open

using multiple mbtiles #38

chpicone opened this issue Nov 25, 2021 · 0 comments

Comments

@chpicone
Copy link
Contributor

chpicone commented Nov 25, 2021

This is the use case of interest.

  • the user wants to use multiple mbtiles databases (like a mosaic). These multiple mbtiles cover a specific area of interest. Suppose that I want to cover the area of Italy and France and for that I want to use italy.mbtiles and france.mbtiles databases.
  • the user wants (from the client application) to make a call without specify the database of interest (because he does not know)
  • a new API /{z}/{x}/{y} should manage both databases and return the correct tile.

I am supposing to work in this way:

  • add a watcher for changes in the folder containing mbtiles (in case a new database is added/removed/updated). In case update in memory metadata info of each database (mainly the BBOX)
  • inside the new route /{z}/{x}/{y} do the following steps:
    • from the z, x, y parameters determine the bbox of the request
    • check wich databases cover the request and return an array sorted by the max probability to find the correct one at the first shoot (maybe the minimum distance between the baricenter of the tile and baricenters of the BBOX covered by the databases)
    • execute the query to the current database (in a loop). If the query returns data BREAK and return the tile to the requester, otherwise move to the other database in the loop (if exists).

Do you think it could be interesting for this project?
Otherwise I will do it only on my forked project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant