Skip to content

Commit

Permalink
Add vis_params option for layer_to_image (#1818)
Browse files Browse the repository at this point in the history
  • Loading branch information
giswqs authored Nov 3, 2023
1 parent 7942483 commit 9dd1808
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion geemap/geemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -4762,6 +4762,7 @@ def layer_to_image(
crs: str = "EPSG:3857",
scale: Optional[int] = None,
region: Optional[ee.Geometry] = None,
vis_params: Optional[Dict] = None,
**kwargs: Any,
) -> None:
"""
Expand All @@ -4773,6 +4774,7 @@ def layer_to_image(
crs (str, optional): The coordinate reference system (CRS) of the output image. Defaults to "EPSG:3857".
scale (int, optional): The scale of the output image. Defaults to None.
region (ee.Geometry, optional): The region of interest for the conversion. Defaults to None.
vis_params (dict, optional): The visualization parameters. Defaults to None.
**kwargs: Additional keyword arguments to pass to the `download_ee_image` function.
Returns:
Expand All @@ -4795,7 +4797,9 @@ def layer_to_image(

layer = self.ee_layers[layer_name]
ee_object = layer["ee_object"]
vis_params = layer["vis_params"]

if vis_params is None:
vis_params = layer["vis_params"]

image = ee_object.visualize(**vis_params)
if not output.endswith(".tif"):
Expand Down

0 comments on commit 9dd1808

Please sign in to comment.