Skip to content
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 default_vis option to cog_tile() function #378

Merged
merged 1 commit into from Mar 1, 2023
Merged

Add default_vis option to cog_tile() function #378

merged 1 commit into from Mar 1, 2023

Conversation

giswqs
Copy link
Member

@giswqs giswqs commented Mar 1, 2023

By default, Map.add_cog_layer() adds a rescale parameter to a single band raster to achieve an optimal visualization. This might not be ideal for some COG files with a built-in colormap in it, such as as land cover maps. This PR adds a default_vis parameter to the function to force leafmap to use the built-in colormap from the data.

Update your package using leafmap.update_package() and restart the kernel to take effect. This improvement will be included in the next leafmap release.

import leafmap
m = leafmap.Map()
url = 'https://data.mundialis.de/geodata/lulc-germany/classification_2021/classification_map_germany_2021_v01_COG.tif'
m.add_cog_layer(url, name='LULC Germany 2021', default_vis=True)
m

image

@giswqs giswqs merged commit 915f4f0 into master Mar 1, 2023
@giswqs giswqs deleted the cog-vis branch March 1, 2023 19:57
@neteler
Copy link
Contributor

neteler commented Mar 1, 2023

Thanks for this quick bugfix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants