Raster

The public API for raster backgrounds is RasterLayer (see Layers). The module-level function below is the underlying implementation.

mappyng.raster.add_raster(map_obj, paths, opacity=1.0, on_zoom=True, on_cartouches=True)[source]

Add raster backgrounds to a Map.

Parameters:
  • map_obj (mappyng.Map) – The map instance.

  • paths (dict) – Mapping of region names to GeoTIFF file paths. Each viewport (main, cartouche, zoom) picks the raster whose geographic footprint overlaps its bbox. Example:

    {
        "metropole": "/path/to/BDTOPO2018_gen3_NC.tif",
        "antilles":  "/path/to/antilles.tif",
        "reunion":   "/path/to/reunion.tif",
        "guyane":    "/path/to/guyane.tif",
    }
    
  • opacity (float) – Raster opacity (0-1, default 1.0).

  • on_zoom (bool) – Render on zoom viewport (default True).

  • on_cartouches (bool) – Render on cartouche viewports (default True).

Return type:

None