简体   繁体   English

有没有办法在放大到比可用的瓷砖更近时制作 folium (python) 高档瓷砖?

[英]Is there a way to make folium (python) upscale tiles when zooming in closer than tiles are available?

I'm plotting a map with the folium python package and it looks beautiful.我正在用叶子python package 绘制一个 map,它看起来很漂亮。 However, the free tileset I'm using (the USGS one, listed here as "USGS.USImagery") only serves tiles up to zoom level 16.但是,我正在使用的免费图块集(USGS 一个,此处列为“USGS.USImagery”)仅提供缩放级别为 16 的图块。

I'd like to be able to zoom in closer than that, as I'm plotting some of my own features on top of those tiles at a higher resolution.我希望能够放大得比这更近,因为我正在以更高的分辨率在这些图块上绘制我自己的一些特征。 Is there a way to tell folium to just upscale the level-16 tiles when zooming to anything above 16?有没有办法告诉 folium 在缩放到 16 以上的任何东西时只放大 16 级的图块? I'm aware they will be pixelated, but I'd rather that than blank grey tiles.我知道它们会被像素化,但我宁愿那样而不是空白的灰色瓷砖。

See this question: Why empty tiles when zoomed "too much" in Leaflet.js?看到这个问题: 为什么在 Leaflet.js 中“过度”缩放时清空图块? on gis.stackexchange:在 gis.stackexchange 上:

And on the folium documentation :folium 文档上:

max_zoom (int, default 18) – Maximum allowed zoom level for this tile layer. max_zoom (int, default 18) – 此图块层允许的最大缩放级别。

max_native_zoom (int, default None) – The highest zoom level at which the tile server can provide tiles. max_native_zoom (int, default None) – 瓦片服务器可以提供瓦片的最高缩放级别。 If provided you can zoom in past this level.如果提供,您可以放大超过此级别。 Else tiles will turn grey.否则瓷砖会变成灰色。

You have to set the max_native_zoom to 14 (in your example), and the max_zoom to a higher value, which matches your higher resolution features.您必须将 max_native_zoom 设置为 14(在您的示例中),并将 max_zoom 设置为更高的值,这与您的高分辨率功能相匹配。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM