<div dir="ltr"><div><br><br>On Fri, Dec 2, 2016 at 11:19 AM, Moritz Lennert <<a href="mailto:mlennert@club.worldonline.be">mlennert@club.worldonline.be</a>> wrote:<br>><br>> On 01/12/16 14:31, Markus Metz wrote:<br>[...]<br>>><br>>> In theory, a higher target resolution should result in a higher total<br>>> sum, a lower target resolution in a lower total sum.<br>><br>><br>> Why is that if we work in densities ?<br><br></div>Sorry, I was not precise, this only applies if you reproject total counts, not densities which are after reprojection converted to total counts.<br><div>><br>> FYI, for all of Madagascar, for pixels of resolution 0:00:02.99988 (i.e. +/- 100m at the equator),<br><br></div><div>+/- 90 meter at the equator<br></div><div><br>> I get an RMSE of about 42m2 between Paulo's formula and area() in r.mapcalc. The error varies between 31 and 52m2, with highest values in the North, i.e. the closer you get to the equator.<br>><br>>><br>>> in the source location<br>>> record absolute count as src_count<br>>> convert absolute count to density per hectare with<br>>> r.mapcalc "pop_dens_ha = 10000.0 * pop_count / area()"<br>>><br>>> in the target location<br>>> set the region according to r.proj -g<br>>> use reasonable grid geometry with e.g. g.region -pa res=100<br>>> reproject pop_dens_ha with r.proj method=bilinear_f<br>><br>><br>> Actually, using area(), and a 100m target resolution, I get closer to the source total with bilinear than with bilinear_f, but in all cases the target total is now _above_ the source total:<br>><br>> Source total: 20714000<br>><br>> Target total - Source total:<br>><br>> nn: 22473<br>> bilinear: 2300<br>> bilinear_f: 26873<br><br></div><div>Not so bad. I would not bother if the difference is positive or negative, as long as the difference is reasonably small relative to the expected count (difference as percent of expected count).<br></div><div><br>><br>>> now density is equal to the absolute count because density is per<br>>> hectare and cell size is 10000 square meter<br>>> record absolute count as tgt_count<br>>><br>>> fix any deviations between src_count and tgt_count with<br>>> r.mapcalc "pop_count_calibrated = pop_dens_ha * $src_count / $tgt_count"<br>>><br>>> this calbration could also be done for administrative units separately<br>><br>><br>> Yes, obviously, by calibrating this way we will get the same total by definition. But this means that we postulate that the "error" is distributed equally across space...<br><br></div><div>No. Unpopulated places remain unpopulated while the "error" in absolute numbers would be more prominent in densely populated places.<br><br></div><div>IMHO, it is in most cases not possible to reproject absolute numbers per cell and maintain the total count for a larger area. Instead, densities should be reprojected, converted back to total counts and then adjusted to match the desired total count per area. The worldpop dataset in question also adjusts total population count to UN estimates.<br><br></div><div>Markus M<br><br></div><div>><br>> Thanks to both of you for the very helpful discussion. I'm afraid few people dealing with these data think much about this problem.<br>><br>> Moritz<br><br></div></div>