Repository navigation
pmtiles elevation data - #3287
Merged
Merged
Conversation
…ation storage eleToUInt(-10000) returned -1000, which when stored as a 3-byte unsigned int (way geometry) lost its sign bits, reading back as 16,776,216. This exceeded MAX_ELE_UINT causing uIntToEle to return Double.MAX_VALUE, producing Infinity in 3D distance calculations. Return 0 instead, the correct encoding for -1000m. Co-Authored-By: Claude Opus 4.6 <[email protected]>
This was referenced Feb 25, 2026
…r cgiar to stay consistent)
Contributor
Could you please add or replace the link with this better link for the mapterhorn.com download? It took me a bit to find where this download is actually described. |
Member
Author
|
I'd prefer to keep it this way. It is not that hard really :) ... and then we do not have to maintain the URL if they change the URL structure and people also are more likely to read about their attribution requirements etc. |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR allows us to read pmtiles elevation data (direct file access, not via web API). From the locally available pmtiles file it creates several temporary files which it memory maps for fast access. Similar to what happens for the other elevation providers (except it is not using DataAccess as for these small files it is not really necessary and a small overhead).
In a future version it might download the portions via http range queries from a hosted pmtiles file, but wasn't goal of this PR. Still you can use the official pmtiles tool to create extracts:
Unfortunately I had to pick the library
com.github.usefulness:webp-imageiowhich is a wrapper oflibwebp. The 100% Java librarycom.twelvemonkeys.imageio:imageio-webphas bugs in its webp implementation that gives wrong (or slightly off?) elevation data for certain cases (although the tests pass and certain regions like saxony are fine! but e.g. germany does not pass at coast.) And when I tried to export those coastal tiles to png I got a different strange error, which seems to be already known. I tested version3.13.1released a few days ago. Btw: instead of the legacy native stuff we could use NightMonkeys which uses FFM, but this would require JDK22.trying to get it faster/smaller:
Disk space needed for planet and zoom=11 is approx 260GB:
Disk space needed for planet and zoom=12 is approx 770GB:
Get the data from the mapterhorn.com project.