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 WIP #107

Closed
wants to merge 2 commits into from

Conversation

stepankuzmin
Copy link
Collaborator

@stepankuzmin stepankuzmin commented Jul 5, 2020

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-107-merge

Relates: #36

@codecov
Copy link

codecov bot commented Jul 5, 2020

Codecov Report

Merging #107 into master will increase coverage by 0.67%.
The diff coverage is 74.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #107      +/-   ##
==========================================
+ Coverage   45.41%   46.08%   +0.67%     
==========================================
  Files          13       14       +1     
  Lines        1319     1341      +22     
==========================================
+ Hits          599      618      +19     
- Misses        720      723       +3     
Impacted Files Coverage Δ
src/lib.rs 41.11% <ø> (ø)
src/composite_source.rs 66.66% <66.66%> (ø)
src/server.rs 43.55% <78.12%> (+3.26%) ⬆️
src/table_source.rs 74.39% <0.00%> (-7.32%) ⬇️

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 ba953d3...2d6102b. Read the comment docs.

@stepankuzmin stepankuzmin added this to the 0.6.0 milestone Jul 5, 2020
@stepankuzmin stepankuzmin linked an issue Jul 5, 2020 that may be closed by this pull request
@sabman
Copy link

sabman commented Jul 7, 2020

@stepankuzmin do we might need to think about performance here? I noticed a performance hit on my local setup, as I increased the tables. I have to dig into the code a bit to see what is going on when registering a composite source. But any pointers from you might be useful.

@robert-claypool
Copy link

@stepankuzmin, with table sources, I think all column values are added to the tile. Is there some way to exclude columns or can this new composite source be extended to support function sources too?

@robert-claypool
Copy link

I've been running this branch daily for weeks now. No issues.

@nicholas-deepblocks
Copy link

Hey @stepankuzmin, many thanks to you and the rest of the team for this great piece of software. Any news on this PR? Sure would be handy to make it official.

@stepankuzmin
Copy link
Collaborator Author

Hi everyone,

Sorry for the delay, I'm refactoring this in my free time. I hope to ship it this month

@sabman
Copy link

sabman commented Feb 12, 2021

@stepankuzmin let us know if you need any help. Happy to fix the merge conflicts if you like.

@stepankuzmin
Copy link
Collaborator Author

Hi everyone

I've rewritten composite sources support in #184

docker pull urbica/martin:pr-184

Could you please try this new image? If everything works well for you, I'm going to release it as v0.6.0

/cc @sabman @robert-claypool @nicholas-deepblocks

@stepankuzmin stepankuzmin deleted the composite-sources branch September 14, 2021 07:21
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.

Support for multi-layer tiles
4 participants