# Basic API

This page documents the main public functions.

## map_raster

mapraster.main.map_raster(raster_ds, originalDataset, footprint, cross_antimeridian=False)

  Map a raster onto an image grid defined by originalDataset.

  Parameters:

    - raster_ds (xarray.Dataset or xarray.DataArray) – Raster with valid .rio accessor.

    - originalDataset (xarray.Dataset) – Dataset defining the target image grid (lon/lat in image dims).

    - footprint (shapely.geometry.Polygon) – Footprint of the target grid.

    - cross_antimeridian (bool, default False)

  Return type:

    xarray.Dataset or xarray.DataArray

## _get_image_dims

mapraster.main._get_image_dims(ds)

  Infer image dimensions from longitude/latitude variables, excluding ‘pol’ if present.