MCPcopy Index your code
hub / github.com/opengeos/leafmap / save

Method save

leafmap/plotlymap.py:546–566  ·  view source on GitHub ↗

Convert a map to a static image and write it to a file or writeable object Args: file (str): A string representing a local file path or a writeable object (e.g. a pathlib.Path object or an open file descriptor) format (str, optional): The desired image format. One of

(
        self,
        file: str,
        format: Optional[str] = None,
        width: Optional[int] = None,
        height: Optional[int] = None,
        scale: Optional[int] = None,
        **kwargs,
    )

Source from the content-addressed store, hash-verified

544 )
545
546 def save(
547 self,
548 file: str,
549 format: Optional[str] = None,
550 width: Optional[int] = None,
551 height: Optional[int] = None,
552 scale: Optional[int] = None,
553 **kwargs,
554 ) -> None:
555 """Convert a map to a static image and write it to a file or writeable object
556
557 Args:
558 file (str): A string representing a local file path or a writeable object (e.g. a pathlib.Path object or an open file descriptor)
559 format (str, optional): The desired image format. One of png, jpg, jpeg, webp, svg, pdf, eps. Defaults to None.
560 width (int, optional): The width of the exported image in layout pixels. If the `scale` property is 1.0, this will also be the width of the exported image in physical pixels.. Defaults to None.
561 height (int, optional): The height of the exported image in layout pixels. If the `scale` property is 1.0, this will also be the height of the exported image in physical pixels.. Defaults to None.
562 scale (int, optional): The scale factor to use when exporting the figure. A scale factor larger than 1.0 will increase the image resolution with respect to the figure's layout pixel dimensions. Whereas as scale factor of less than 1.0 will decrease the image resolution.. Defaults to None.
563 """
564 self.write_image(
565 file, format=format, width=width, height=height, scale=scale, **kwargs
566 )
567
568 def add_choropleth_map(
569 self,

Callers 13

to_htmlMethod · 0.95
to_htmlMethod · 0.95
image_overlayMethod · 0.80
__init__Method · 0.80
numpy_to_imageFunction · 0.80
add_mask_to_imageFunction · 0.80
png_to_gifFunction · 0.80
add_text_to_gifFunction · 0.80
add_progress_bar_to_gifFunction · 0.80
add_image_to_gifFunction · 0.80
make_gifFunction · 0.80
pillow_to_base64Function · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected