Raster

The public API for raster backgrounds is Raster (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, z=None)[source]

Add raster backgrounds to a Map.

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

  • paths (dict or str) – Mapping of region names to GeoTIFF file paths, or a single path. 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).

  • z (int, optional) – Stacking depth. By default the raster is drawn behind every other layer; a larger value lifts it above lower layers.

Return type:

None