> For the complete documentation index, see [llms.txt](https://docs.mapbox.com/mapbox-tiling-service/llms.txt)

# Supported File Formats

The **Mapbox Tiling Service** tool supports following Raster sources-

-   3 different file types: GeoTIFF, GRIB, and NetCDF for `"type":"rasterarray"` recipe.
-   GeoTIFF for `"type":"raster"` recipe.

Each individual source file must not exceed 20 GB. The maximum combined total size of all files that compose a tileset source is 50 GB. If the total size of all the files that compose a tileset source is greater than 50 GB, MTS will return a response that contains an error property with more details.

## GeoTIFF

The [GeoTIFF](https://www.ogc.org/standard/geotiff/) file format is commonly used for visual RGB/RGBA imagery data but can also be used for multi-dimensional raster data. Using [rasterio](https://github.com/rasterio/rasterio/tree/main) CLI tool, we can inspect a GeoTIFF file.

```bash
rio info sample.tif
```

For `"type":"raster"` recipe jobs, data must be `"dtype": "uint8"`, representing 8-bit data. Additionally, the data must *not* have the `"photometric": "ycbcr"` property, as Raster MTS only supports RGB photometric interpretation.

## GRIB

[GRIB](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/), or GRIdded Binary, is a file format used to store gridded weather data.

To view the content of a GRIB file, use [this GRIB viewer tool](https://labs.mapbox.com/rmts-tool/).

## NetCDF

[NetCDF](https://nsidc.org/data/user-resources/help-center/what-netcdf) or Network Common Data Form is a self-describing file format that can contain multi-dimensional raster data. This format is commonly used to store weather related data.

There are a couple useful utilities for inspecting NetCDF files including [`gdalinfo`](https://gdal.org/programs/gdalinfo.html) and [`ncdump`](https://github.com/jllodra/ncdump-json).

Using `ncdump` we can inspect the variables and dimensions of a file. Adding the `-h` flag below will return the header data of the file. Below are some examples of using `ncdump` and `gdalinfo` on some [sample data from Japan Meteorological Agency](https://www.data.jma.go.jp/mscweb/en/himawari89/space_segment/sample_netcdf.html).

```bash
ncdump -h NC_H09_20170308_0230_B01_JP02_R10.nc
```

Truncated output from running `ncdump` on the above file.

```
netcdf NC_H09_20170308_0230_B01_JP02_R10 {
dimensions:
        latitude = 2701 ;
        longitude = 3301 ;
        start_time = 1 ;
        end_time = 1 ;
variables:
        float latitude(latitude) ;
                latitude:units = "degrees_north" ;
                latitude:long_name = "latitude" ;
        float longitude(longitude) ;
                longitude:units = "degrees_east" ;
                longitude:long_name = "longitude" ;
        float albedo(latitude, longitude) ;
                albedo:units = "1" ;
                albedo:long_name = "reflectivity" ;
                albedo:_FillValue = -1.f ;
...
```

Using this information, we can decide what variable we might want to dig deeper into using `gdalinfo`. When opening a NetCDF file with `gdalinfo`, you'll want to specify the NetCDF driver as well as the variable that you want to access. The driver is necessary as `gdalinfo` might open the NetCDF file using the wrong driver if the filename is missing an extension. The variable allows `gdalinfo` to provide the bands for that specific variable. You can find more information on how to use `gdal` with NetCDF files in their [official documentation](https://gdal.org/drivers/raster/netcdf.html).

```bash
gdalinfo netcdf:NC_H09_20170308_0230_B01_JP02_R10.nc:albedo
```