GithubHelp home page GithubHelp logo

Comments (18)

reyemtm avatar reyemtm commented on August 27, 2024

Is this the same issue as with the maxzoom parameter being ignored for GL JS maps when using a serverless setup? Currently Maplibre keeps requesting tiles from the pmtiles source beyond the maxzoom set in the style when using a serverless source.

from pmtiles.

reyemtm avatar reyemtm commented on August 27, 2024

For GL JS styles it would appear that the maxzoom needs to be set to 12 for a serverless setup, not 14 as in the example styles available from the pmtiles download. However there are tiles beyond 12 which I can tell from comparing a serverless map to the theme examples.

  • Are the tiles served from the theme example page tiled to a higher zoom than 14, or are these the same tiles output from the downloads site?
  • If they are the same...any ideas as to why in GL nothing appears after zoom level 13?

from pmtiles.

bdon avatar bdon commented on August 27, 2024

@reyemtm did you download from https://protomaps.com/downloads/large_map ? if so it's possible your PMTiles archive only goes down to 12, because the total # of tiles in a single export is limited to 10,000. a Smaller area might get you down to 14.

from pmtiles.

reyemtm avatar reyemtm commented on August 27, 2024

from pmtiles.

reyemtm avatar reyemtm commented on August 27, 2024

Confirmed downloading a smaller area fixed the issue.

from pmtiles.

allthesignals avatar allthesignals commented on August 27, 2024

Oh! I see, so tiles beyond z14 are not supported in single-file? See: https://tulsa-crash-map.netlify.app/#13/36.15138/-95.98636 vs https://tulsa-crash-map.netlify.app/#14/36.15138/-95.98636.

Any ideas on workarounds? I suppose a second layer with regular XYZ would do the trick...

Separately, how do zooms beyond 14 work on this map? Or am I missing something?

Note: I'm using the python bin for this. Also, it's possible I'm doing something wrong during the mbtiles step.

from pmtiles.

bdon avatar bdon commented on August 27, 2024

What source did you get the first one from? It looks like it only contains tiles down to z13, which might have been introduced as a limitation if you downloaded a "large map" (confusing right now, I know)

The client uses overzooming, so when you go beyond 14 in MapLibre, your data source is still the z14 tile, although your zoom-dependent styling can show different features at 15, 16, 17 etc.

Currently the implementations only support one leaf level, so up to z14. In practice, most vector tile applications get enough resolution with z14, but it's worth supporting z15 for the cases that do really need it as well as raster tiles.

from pmtiles.

allthesignals avatar allthesignals commented on August 27, 2024

Thank you for the reply! I've been obsessed with this awesome work for the past few days.

What source did you get the first one from? It looks like it only contains tiles down to z13, which might have been introduced as a limitation if you downloaded a "large map" (confusing right now, I know)

Ah, I see, okay. So, the basemap is a small area map extract. I see what you mean by the maxzoom in the source data.

However, I'm interested in why my red point data (which is generated from pmtiles-convert command), doesn't appear beyond zoom 13:
image
image

Apologies if I'm missing something entirely.

from pmtiles.

allthesignals avatar allthesignals commented on August 27, 2024

Further thinking: I believe maplibre-gl is not over-zooming past the specified maxzoom of this particular set of pmtiles for some reason.

I can confirm this when I view the mbtiles version of the dataset in mapbox-gl, where it does the overzooming beyond the maxzoom.

So it might be:

  1. maplibre-gl is not overzooming using the ProtocolCache from the pmtiles JavaScript library
  2. something is wrong with the way I've generated these particular pmtiles
  3. some combination of both

I'm not sure why it would be explanation 1) because maplibre-gl overzooms beyond the maxzoom with the basemap pmtiles just fine.

I'm going to try a few different things but any observations would help! Thank you! :)

(I realize this discovery moves it outside the intention of this particular issue).

from pmtiles.

allthesignals avatar allthesignals commented on August 27, 2024

OKAY I figured it out. It's because I needed to explicitly specify the maxzoom in my source configuration. I'm sure that's documented somewhere. Sorry, I really went down a rabbit hole there. I'm not sure how mbview works but I wonder if it infers the maxzoom from the metadata? Anyway, thanks for letting me bounce ideas here.

from pmtiles.

bdon avatar bdon commented on August 27, 2024

@allthesignals yeah, that makes sense. Ideally, the PMTiles maplibre adapter should read the metadata from the archive and then populate maxzoom correctly, but with the way addProtocol works right now I don't think that is straightforward to do.

from pmtiles.

bdon avatar bdon commented on August 27, 2024

Opened #48

from pmtiles.

wipfli avatar wipfli commented on August 27, 2024

PMTiles are so cool! Thanks @bdon for all the work you put into this :)

I run into a similar issue with the map disappearing when going to zoom level 13 and more. I generated the tiles with planetiler in https://github.com/wipfli/swiss-map which creates a 239 MB mbtiles and a 329 MB pmtiles file. My workaround there was to limit to zoom 12 in the tiles:

  "sources": {
    "swissmap": {
      "type": "vector",
      "tiles": ["pmtiles://output.pmtiles/{z}/{x}/{y}"],
      "maxzoom": 12
    }
  },

But then details will be missing from levels 13, 14.

from pmtiles.

bdon avatar bdon commented on August 27, 2024

Yeah, unfortunately there is no way through maplibre addProtocol to auto-detect the max zoom of the archive, you'll need to specify it in the style. However, it definitely should be the case that all the tiles in the source mbtiles end up in the pmtiles result, can you tell me what pmtiles-convert version you are using?

from pmtiles.

wipfli avatar wipfli commented on August 27, 2024

I used the command pmtiles-convert data/output.mbtiles output.pmtiles, here is the version:

➜  swiss-map git:(main) ✗ pip3 show pmtiles   
Name: pmtiles
Version: 1.1.0
Summary: Library and utilities to write and read PMTiles files - cloud-optimized archives of map tiles.
Home-page: https://github.com/protomaps/pmtiles
Author: Brandon Liu
Author-email: [email protected]
License: BSD-3-Clause
Location: /home/wipfli/.local/lib/python3.8/site-packages
Requires: 
Required-by:

You can download the mbtiles and pmtiles file here:

from pmtiles.

wipfli avatar wipfli commented on August 27, 2024

I installed v1.3.0 and the issue with the missing tiles is gone. Sorry for not checking earlier @bdon...

from pmtiles.

bdon avatar bdon commented on August 27, 2024

@wipfli ok, thanks for letting me know! btw, for the v3 mbtiles conversion tool I'm considering releasing that as a standalone binary (go version) instead of getting pmtiles-convert through python, is that better/worse for you in any way?

from pmtiles.

wipfli avatar wipfli commented on August 27, 2024

Also long as it is easy to get and run on ubuntu, I think a standalone binary is fine too...

from pmtiles.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.