-
Notifications
You must be signed in to change notification settings - Fork 645
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 pmtiles support #1009
Add pmtiles support #1009
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried reviewing since you asked for JS developers. I did not try to understand how pmtiles work. So only small suggestions.
Thanks for the reviews. If you or anyone does have any interest in how the pmtiles work, their spec was really useful but I also was reverencing and using bits of the pmtiles javascript code a lot from PMTiles is interesting because you can use it without a tilesserver and just host on http. however having a tileserver does have some advantages I think, like our built in styling and inspect. I also personally don't like the idea that people could download any of the pmtiles maps served over http, so bringing it into tileserver kind of hides your file locally in a place people can't get to it. |
I figured out how to rework this so I am able to use more of the functions included in the pmtiles npm package. In my original attempt I hade tried to use code based on pmtiles FileAPISource , however I had issues with this because it tried to load the whole file into memory, which would fail with files over 2GB and was very slow. Because of that my second attempt went to reading just the bits of the files I needed, however because I went that route, I was not able to use many of the inbuilt pmtiles functions, and had to include a bunch of extra code to read the file that I didn't need in the first attempt. my third attempt tries to combine the first and second attempt. I took the functions I made to read bytes from the second attempt and moved them into the custom source based on FileAPISource |
I think I have gotten this to also support web based pmtiles.. For example, I can now specify a http(s) url as my file like If you add the --verbose flag you can see this generates a config like this which specifies a 'pmtiles' data source with a url
One thing to note is when running this way, tileserver-gl is bascailly acting as the pmtiles client, so it is basically proxying requests to a remote server. this means the server is going to be both downloading and uploading tiles. |
Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
This reverts commit 727187b.
Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
move into metadata Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
Get mbtiles load working again Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
Signed-off-by: Andrew Calcutt <[email protected]>
This PR adds pmtiles support into tileserver-gl
I've made a new file pmtiles_adapter.js which contains functions tileserver-gl needs read the metadata from the file and to serve specific zxy tiles.
Whats working
Whats needed