rubem.validation.grid_cell_size.check_grid_cell_size

check_grid_cell_size(grid, pixel_width, pixel_height, crs_wkt, file)[source]

Compare the declared cell size with the pixel size of a raster.

The comparison only happens when crs_wkt describes a projected coordinate reference system: the pixel size is then converted to metres through the linear unit of the system and compared with grid. A geographic system, an engineering (local) system and a raster without any coordinate reference system yield no problem; an informational message states the declared cell size and what the raster offers instead.

Parameters:
  • grid (float) – Cell size declared by the configuration, in metres.

  • pixel_width (float) – Pixel size along x, in the unit of the system (signed).

  • pixel_height (float) – Pixel size along y, in the unit of the system (signed).

  • crs_wkt (str | None) – The reference coordinate reference system as WKT, if any.

  • file – The raster the geometry was read from, named by the problem.

Return type:

Problem | None

Returns:

A blocking Problem when the relative difference of either axis exceeds TOLERANCE, None otherwise.