Closed crstn closed 8 years ago
I just looked through a few of the countries that have this incongruity, and I'm pretty sure I understand what's going on: For both the GLUR and spatial population rasters, there are no data cells that correspond to areas that are uninhabitable (e.g., large bodies of water). I'm not sure how these areas were determined by whomever produced the data. It appears that with these countries, there are incongruities between what cells have no data, and what cells have a zero value. So, for example, a portion of the GLUR raster might have no data at a major lake, but the population raster includes some of that lake's geometry, populated with zero values. So despite the fact that the rasters have the same overall rows/columns, there are different internal counts resulting from this no-data incongruity (and it goes both ways; for some countries there are GLUR cells with 'rural' values where the population raster has no data.
Here's a quick snapshot of part of Mali, where this is happening. The layers are, in top-bottom order: 1) GLUR Array (RED) 2) Population Array (BLUE) 3) Basemap
So where we're seeing blue, there is no-data for the GLUR raster, but population data (== 0) for the population array. Then where the population raster also has no data, we're seeing the basemap.
Is this problem systematic enough that we can say: if between the two rasters there is a no-data and a zero, we can safely assume no data?
The question is also whether this throws our indexing off? If we have such a pixel mismatch, will all pixels after that be one pixel off when we look e.g. for a rural cell in one array, and then use that index to change the population of that cell in the population array?
@pmarcotullio and I just discussed this: if the rural/urban raster has a no data cell, and that cell has a 0 in the population raster, then we also set the population raster to no data.
I just discovered – by coincidence – that for 48 countries, these two arrays are not of the same length. Here's a list of a all countries where the values don't match: