contextily icon indicating copy to clipboard operation
contextily copied to clipboard

Publicize _calculate_zoom

Open martinfleis opened this issue 4 years ago • 3 comments

I think that contextily.tile._calculate_zoom should be part of a public API. It is useful if you want to fine-tune zoom levels, to know which one you start from. And it is also part of the intro guide. https://contextily.readthedocs.io/en/latest/intro_guide.html#Fine-tune-zoom-levels

martinfleis avatar Mar 02 '21 13:03 martinfleis

+1 to make this easier in some way.

For me a potential downside of calculate zoom is that it requires (w, s, e, n)(but we could also improve the interface of course, eg accepting a geodataframe in different crs). Another idea that I had at some point would be to add a verbose=True option to add_basemap (and other similar functions), which would eg print which zoom level is being used, so it's easier to set it slightly larger/smaller. Of course, that can only be used interactively, as it's not a function.

jorisvandenbossche avatar Mar 02 '21 20:03 jorisvandenbossche

+1 Also, related, I've been using the new overlay feature and I find consistently that I end up going for the default value of zoom - 1 (one more zoomed out). Is this something you run into as well? If so, maybe we could change the 'auto' algorithm to have that as default?

darribas avatar Mar 03 '21 13:03 darribas

I find consistently that I end up going for the default value of zoom - 1 (one more zoomed out). Is this something you run into as well?

I was changing the zoom level for overlay labels in about 50% of cases.

martinfleis avatar Mar 03 '21 13:03 martinfleis