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

Static Image Generation Only Uses one Tile #5

Closed
boldtrn opened this issue Sep 13, 2022 · 13 comments
Closed

Static Image Generation Only Uses one Tile #5

boldtrn opened this issue Sep 13, 2022 · 13 comments

Comments

@boldtrn
Copy link

boldtrn commented Sep 13, 2022

I just tried to use the static tile generation. However, the resulting tiles seems to be only using one tile.

I can see that there is a warning in the log:

mlgl: {
  class: 'General',
  severity: 'WARNING',
  text: 'Provided camera options returned 4 tiles, only 11/1100/671=>11 is taken in Tile mode.'
}
GET /styles/my-style/static/13.389587,52.515359,12/500x500.png 200 162572 - 63.870 ms

The generated static map looks like this:
500x500

The same with the "old tileserver-gl" looks like this:
500x500 (1)

To me it seems that only one source tile is used, the warning message seem to hint at that as well. Interestingly some text is still used on the empty tiles? This seems to be related to the observations made here: maptiler#542

@acalcutt
Copy link
Owner

I'm not to familiar with static images but I will check it out. For you second image, do you know what version of tileserver-gl is running there? The thread you links seems to suggest it relates to tile mode, which was added after tileserver 3.0.0 . Are you running 3.1.0+ in that second example?

@boldtrn
Copy link
Author

boldtrn commented Sep 13, 2022

Sorry for creating so much trouble :). The second image is done with maptiler/tileserver-gl:v3.1.0. I can check other versions if this would help you in debugging this case?

@acalcutt
Copy link
Owner

that version should be fine, I just wanted to make sure the version you are using was after tile mode was added. probably means there is something to find in maplibre-native

@acalcutt
Copy link
Owner

I can confirm the issue on my server https://tiles.wifidb.net/styles/WDB_OSM/static/13.389587,52.515359,12/500x500.png

@acalcutt
Copy link
Owner

looking at the maplibre-native render tests, its somewhat similar to this failed test

image

Its supposed to look like this, but it is trimming the map at the tile borders
expected

@acalcutt
Copy link
Owner

Similar warnings too

# xvfb-run -a ./build/mbgl-render-test-runner --manifestPath metrics/macos-xcode11-release-style.json --filter "render-tests/map-mode/tile-avoid-edges"
[WARNING] {mbgl-render-tes}[ParseStyle]: The 'width' metadata field is ignored in tile map mode
[WARNING] {mbgl-render-tes}[ParseStyle]: The 'height' metadata field is ignored in tile map mode
[WARNING] {mbgl-render-tes}[General]: Provided camera options returned 4 tiles, only 13/2099/3045=>13 is taken in Tile mode.
[WARNING] {mbgl-render-tes}[General]: Provided camera options returned 4 tiles, only 13/2099/3045=>13 is taken in Tile mode.
[WARNING] {mbgl-render-tes}[General]: Provided camera options returned 4 tiles, only 13/2099/3045=>13 is taken in Tile mode.
[WARNING] {mbgl-render-tes}[General]: Provided camera options returned 4 tiles, only 13/2099/3045=>13 is taken in Tile mode.
[WARNING] {mbgl-render-tes}[General]: Provided camera options returned 4 tiles, only 13/2099/3045=>13 is taken in Tile mode.
[WARNING] {mbgl-render-tes}[General]: Provided camera options returned 4 tiles, only 13/2099/3045=>13 is taken in Tile mode.
[WARNING] {mbgl-render-tes}[General]: Provided camera options returned 4 tiles, only 13/2099/3045=>13 is taken in Tile mode.
[WARNING] {mbgl-render-tes}[General]: Provided camera options returned 4 tiles, only 13/2099/3045=>13 is taken in Tile mode.
[INFO] {mbgl-render-tes}[General]: GPU Identifier: llvmpipe (LLVM 11.0.1, 256 bits)
[WARNING] {mbgl-render-tes}[General]: Provided camera options returned 4 tiles, only 13/2099/3045=>13 is taken in Tile mode.
[WARNING] {mbgl-render-tes}[General]: Provided camera options returned 4 tiles, only 13/2099/3045=>13 is taken in Tile mode.
* failed render-tests/map-mode/tile-avoid-edges
1 failed (100.0%)

@acalcutt
Copy link
Owner

acalcutt commented Sep 16, 2022

I made a new custom maplibre-gl-native release that removes this commit maplibre/maplibre-native@9ceb619 . it is @acalcutt/maplibre-gl-native 5.2.2

Then I made a new Tileserver-GL release that uses this package, v4.0.23. Can you try out this release and tell me how it works for you. it seems to fix static tiles for me.

@boldtrn
Copy link
Author

boldtrn commented Sep 16, 2022

Thank you very much, this fixes the static tile generation on my server as well. It would be great if we could get this merged updstream at gl-native as well, WDYT?

@acalcutt
Copy link
Owner

acalcutt commented Sep 16, 2022

I'm trying to get it there, but upstream changes can be slow.

On the maplibre side it is usually hard to convince them the fix is to delete a block of code. obviously it works, but they asked me if i could make tileserver go into staic mode instead of tile mode when doing static images. however looking at the tileserver code that doesn't seem simple because it builds a pool of renderers when it loads, then uses them for various purposes later. unfortunately tile mode is needed for everything else but static tiles.

On the Tilserver-gl side i have started to add some PRs to get some of my changes there. However @kloklan wants to meet me first and discuss the changes. they want more gradual piecemeal PRs there and right now it is somewhat slow to get them approved. I'm supposed to meet with him next week, but I'm not sure whats going to come of that.

@acalcutt
Copy link
Owner

Also, i am trying not to use my realease of maplibre-gl-native is the maptiler version, so it really does need a fix upsteam.

@boldtrn
Copy link
Author

boldtrn commented Sep 16, 2022

Perfectly understandable, thanks for explaining. So far I am really happy that we have a working server 🎉

I would be happy to close this issue, or do you want to keep it open until we have an upstream solution?

@acalcutt
Copy link
Owner

acalcutt commented Sep 16, 2022

I'd close this for now. I have my issue open upstream to try and get this officially fixed, so I think that is enough of a reference. I'll keep my maplibre-native until we figure out a better solution.

@boldtrn
Copy link
Author

boldtrn commented Sep 16, 2022

Ok perfect, let's close then :)

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

2 participants