-
-
Notifications
You must be signed in to change notification settings - Fork 807
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
Add render test for 3D terrain #1320
Conversation
Tests that the root level terrain object must be in the following form: "terrain": { "source": string, "exaggeration": number, "elevationOffset": number }
Bundle size report: Size Change: 0 B
ℹ️ View DetailsNo major changes |
I generally think you did the right thing. |
The original test was failing because there were no terrain tiles available at the zoom being requested. Now it's testing at zoom 13, which means requesting terrain tiles at zoom 12, which are available to the tests.
Thanks for the suggestion, it helped me track down the problem. It was a trivial fix in the end. I also altered the render test so that it has an explicit check for the bug described in #1241 — the terrain render test passes on this branch but fails on The integration tests failed on MacOS but I don't think that has anything to do with these code changes, it just timed out. It might be that re-running it will get it to pass but I don't have permission to try that. |
Started a re-run of the failing tests.
|
All tests are passing and the image looks great! |
Thanks, @wipfli, that did the trick. All tests pass now. |
@HarelM Do you mean "terrain": {
"source": "terrain",
"exaggeration": 2,
"elevationOffset": 2000
} |
Ahh, great! I totally missed that when I added the terrain to the style spec... Thanks! |
I did yes, and it's partly-transparent there too. Here's the (buggy) output from the render test when run on the And here's the actual output after this PR: |
Great! Thanks! |
Cool |
* Fixes maplibre#1241 - correct coveringTiles when terrain is enabled * fix lint * Add unit test for calculating min/max elevation (maplibre#1316) * Add unit test for calculating min/max elevation * Use correct method name * Move min/max elevation value calc to Terrain class * Alter Terrain.getMinMaxElevation to take tileID arg * Fix unit tests after merge from main * Fix lint * Add render test for 3D terrain (maplibre#1320) * Add terrain style spec integration test Tests that the root level terrain object must be in the following form: "terrain": { "source": string, "exaggeration": number, "elevationOffset": number } * Add work-in-progress render test for 3D terrain * Fix terrain render test so it passes The original test was failing because there were no terrain tiles available at the zoom being requested. Now it's testing at zoom 13, which means requesting terrain tiles at zoom 12, which are available to the tests. * Update terrain render test to test fix for maplibre#1241 The fix for maplibre#1241, commit 352bc03, ensures that elevationOffset is taken into account when gauging which tiles are required to render 3D terrain. If we add an extreme offset then we have a test that fails on the current main branch but passes after the fix. * Add changelog comment Co-authored-by: Matt Riggott <flother@users.noreply.github.com> Co-authored-by: HarelM <harel.mazor@gmail.com>
This is a follow-on from PR #1316. I've had a go at creating a render test for the new 3D terrain but I can't get the test to output the correct result.
The
style.json
in the test takes two sources, a TerrainRGBraster-dem
and a satelliteraster
, and adds the satellite imagery as a layer and the TerrainRGB source as 3D terrain. The map is pitched to 60°. What I would expect to see is the satellite raster draped over the 3D terrain. But what I see is a flat map with satellite imagery but no 3D terrain. You can run the test yourself by checking out this PR and running:This will fail and the test will produce this image:
I'm not sure what I'm missing, so I was hoping for input from @HarelM and @prozessor13. Is there anything obviously missing from the test to get the 3D terrain in the actual result? I've tried waiting/sleeping in the
style.json
'smetadata.test.operations
, to no avail. I've also tried (unsuccessfully) to add the terrain as an operation using: