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

feat: add composite sources support #184

Merged
merged 26 commits into from
Apr 24, 2021
Merged

Conversation

stepankuzmin
Copy link
Collaborator

@stepankuzmin stepankuzmin commented Feb 21, 2021

This PR allows composing multiple table sources into one composite source. Table sources endpoints now support multiple tables in one request. E.g you can request tiles that contain data from multiple tables by listing the tables separated by a comma:

/{schema_name1}.{table_name1},{schema_name2}.{table_name2}.json
/{schema_name1}.{table_name1},{schema_name2}.{table_name2}/0/0/0.pbf

Using with Mapbox GL JS

map.addSource('points', {
  type: 'vector',
  url: `http://0.0.0.0:3000/public.red_points,public.blue_points.json`
});

map.addLayer({
  id: 'red_points',
  type: 'circle',
  source: 'points',
  'source-layer': 'public.red_points',
  paint: {
    'circle-color': 'red'
  }
});

map.addLayer({
  id: 'blue_points',
  type: 'circle',
  source: 'points',
  'source-layer': 'public.blue_points',
  paint: {
    'circle-color': 'blue'
  }
});

You can try this docker image with composite sources support and give any feedback on this

docker pull urbica/martin:pr-184

Relates: #36 #107

@codecov
Copy link

codecov bot commented Feb 21, 2021

Codecov Report

Merging #184 (20005fc) into master (e953aa3) will increase coverage by 2.23%.
The diff coverage is 77.69%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #184      +/-   ##
==========================================
+ Coverage   41.14%   43.37%   +2.23%     
==========================================
  Files          13       14       +1     
  Lines        1541     1623      +82     
==========================================
+ Hits          634      704      +70     
- Misses        907      919      +12     
Impacted Files Coverage Δ
src/lib.rs 34.88% <ø> (+0.34%) ⬆️
src/table_source.rs 65.21% <41.93%> (-15.03%) ⬇️
src/composite_source.rs 78.94% <78.94%> (ø)
src/server.rs 40.81% <89.28%> (+3.14%) ⬆️
src/dev.rs 100.00% <100.00%> (ø)
src/utils.rs 66.66% <100.00%> (+5.30%) ⬆️
... and 1 more

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 e953aa3...e2df496. Read the comment docs.

@stepankuzmin stepankuzmin merged commit 3c01125 into master Apr 24, 2021
@stepankuzmin stepankuzmin deleted the composite-sources-v2 branch April 24, 2021 17:19
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.

1 participant