A raster that covers the world, or a whole country, at 30 m would be too large to store or download as one file. Providers cut it into tiles, which are smaller rasters that sit side by side on a grid. You download the tiles that cover your area, join them into one raster, and cut that to the shape of your study area. These steps are mosaicking and clipping, and they are among the first things you do with any raster data.
How tiles are laid out
Each provider chooses a tile scheme. A global elevation model such as Copernicus DEM comes in tiles of one degree by one degree, named after the latitude and longitude of the corner. Sentinel-2 uses the military grid reference system, with tiles of about 110 km by 110 km in the UTM zones, and a name such as T43RFQ. Neighbouring Sentinel-2 tiles overlap by about 10 km, so that no strip of ground falls between them. Landsat uses a path and row system based on the orbits of the satellite. Every scheme has its own coordinate system, tile size and file naming, and you need to read the product guide once to find the tile for your place.
An area of interest often crosses a tile edge. A district of 80 km can touch two or four tiles. That is the moment you need a mosaic.
What has to match
You can join rasters only if they agree on these points:
- The coordinate system. Tiles from different UTM zones, such as a scene on each side of a zone boundary, are in different systems. Reproject one first. The guide to reprojecting shows how.
- The cell size. Tiles of one product share a cell size. If you mix products, resample one to the other.
- The data type and the NoData value. If one tile stores heights as 32-bit floats and another as integers, or if the NoData values differ, the mosaic can hold wrong values. Set NoData explicitly.
- The grid alignment. The cells of the tiles must fall on the same grid, so that cell edges line up from one tile to the next.
The last point is the one that surprises people. The Copernicus DEM tiles are cut so that their cells are centred on whole degrees, which means their edges are half a cell off the whole degree. If you ask for a window with edges on whole degrees, the window starts half a cell inside a tile and the result has an empty row or column at the edge. The mosaic guide found this on real data and fixes it by snapping the box to the tile grid. A mosaic should be cut to the grid of its tiles, and not to an arbitrary box.
Overlaps and seams
When two tiles overlap, the cells in the overlap have two values, and the mosaic needs a rule to pick one. The common rules are: first, the value of the first file listed, last, the value of the last, mean, the average of both, and min or max. For elevation, where overlaps hold the same ground, the choice hardly matters. For satellite images taken on different days, it matters a lot. A seam shows where two scenes meet, because the light, the haze or the crop stage differ from one date to the other. A seam in a mosaic of images is not a fault of the software, it is a real difference between the scenes. Use scenes from the same date where you can, or build a composite that takes the median of many dates, as in the time series tutorials.
Virtual mosaics
A mosaic does not have to be a new file. A virtual raster, which GDAL calls a VRT, is a small text file that lists the tiles and says how they fit together, and any program that reads it sees one raster. It costs no disk space and takes no time to make. QGIS Build Virtual Raster makes one. You turn it into a real file only when you need to share it or when reading it becomes slow.
Clip, crop and mask
These three words are often used as if they were the same, and they are not.
Crop, or clip by extent, keeps the cells inside a rectangle. The result is a smaller raster, still a rectangle. Use it to cut a big file down to the box of your study area.
Mask, or clip by a mask layer, sets the cells outside a polygon to NoData. The result keeps the original rectangle unless you also crop it, and the cells outside the boundary stay but hold nothing. Use it when the outline of the area matters, for example before taking a mean over a district.
Crop to the mask does both: it masks to the polygon and shrinks the rectangle to the box of the polygon. This is what most people mean by clipping a raster to a district. The clip guide shows it in QGIS and in Python, and it checks that the two routes agree.
A clip does not change the cell values or the cell size. If the polygon is in a different coordinate system from the raster, convert the polygon, not the raster, so that the raster is not resampled for no reason.
Resampling in short
Any step that moves a raster to a new grid, such as a reprojection or a change of cell size, has to guess the values of the new cells from the old ones. Nearest neighbour copies the closest value and keeps classes intact, so use it for land cover. Bilinear averages the four nearest cells and gives smooth values, so use it for heights and reflectance. Cubic is smoother again and can overshoot. A mosaic of tiles on the same grid needs no resampling, and that is another reason to keep the grids aligned.
File size and speed
A raster that is saved with tiling, compression and overviews, as in a Cloud Optimized GeoTIFF, can be read in pieces. Software then asks only for the part it needs, and you can read a small window of a huge file over the internet without downloading the whole thing. The format guide shows how to make one.
Common mistakes
- Joining tiles in different coordinate systems.
- Letting NoData differ between tiles, so that the NoData cells turn into data.
- Cutting a mosaic to a box that does not follow the tile grid, which leaves an empty row or column.
- Taking a mean over a clipped raster without masking, so the cells outside the boundary count.
- Reprojecting the raster to match the polygon, when it is the polygon that should move.

