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

:feature: Support fetching multiple layers in a single DB trip #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

furious-luke
Copy link

When dealing with maps with many layers there can be many API calls,
or, many DB hits depending on how the API is structured. These changes
allow for a single DB hit to fetch and concatenate all required layers
into a single response.

Please note that this work is currently just a proof-of-concept. I
would want to add tests, documentation, and clean up the code a
bit. I'd like to hear back about whether you think this is valuable or
not before comitting to tidying it up. Cheers!

When dealing with maps with many layers there can be many API calls,
or, many DB hits depending on how the API is structured. These changes
allow for a single DB hit to fetch and concatenate all required layers
into a single response.
@codecov
Copy link

codecov bot commented Jun 28, 2021

Codecov Report

Merging #25 (f339fff) into master (dfef1db) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #25   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            7         7           
  Lines          156       164    +8     
=========================================
+ Hits           156       164    +8     
Impacted Files Coverage Δ
vectortiles/mixins.py 100.00% <100.00%> (ø)
vectortiles/postgis/mixins.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dfef1db...f339fff. Read the comment docs.

@submarcos
Copy link
Owner

Thank you for suggestion. I'm already thinking about including multiple layer per tile. I suggest to enhance MTVView to use multiple Layer definitions. And cache each layer tile per model last update. Then concatenate each cached tile in response. I think it would be a better way than execute a single database query which can be so large.

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

Successfully merging this pull request may close these issues.

2 participants