[GRASS-dev] how to reproject a raster map with absolute numbers without losing data

Markus Metz markus.metz.giswork at gmail.com
Fri Dec 2 14:56:40 PST 2016


On Fri, Dec 2, 2016 at 11:19 AM, Moritz Lennert <
mlennert at club.worldonline.be> wrote:
>
> On 01/12/16 14:31, Markus Metz wrote:
[...]
>>
>> In theory, a higher target resolution should result in a higher total
>> sum, a lower target resolution in a lower total sum.
>
>
> Why is that if we work in densities ?

Sorry, I was not precise, this only applies if you reproject total counts,
not densities which are after reprojection converted to total counts.
>
> FYI, for all of Madagascar, for pixels of resolution 0:00:02.99988 (i.e.
+/- 100m at the equator),

+/- 90 meter at the equator

> 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.
>
>>
>> in the source location
>> record absolute count as src_count
>> convert absolute count to density per hectare with
>> r.mapcalc "pop_dens_ha = 10000.0 * pop_count / area()"
>>
>> in the target location
>> set the region according to r.proj -g
>> use reasonable grid geometry with e.g. g.region -pa res=100
>> reproject pop_dens_ha with r.proj method=bilinear_f
>
>
> 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:
>
> Source total: 20714000
>
> Target total - Source total:
>
> nn: 22473
> bilinear: 2300
> bilinear_f: 26873

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).

>
>> now density is equal to the absolute count because density is per
>> hectare and cell size is 10000 square meter
>> record absolute count as tgt_count
>>
>> fix any deviations between src_count and tgt_count with
>> r.mapcalc "pop_count_calibrated = pop_dens_ha * $src_count / $tgt_count"
>>
>> this calbration could also be done for administrative units separately
>
>
> 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...

No. Unpopulated places remain unpopulated while the "error" in absolute
numbers would be more prominent in densely populated places.

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.

Markus M

>
> Thanks to both of you for the very helpful discussion. I'm afraid few
people dealing with these data think much about this problem.
>
> Moritz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20161202/faac3d65/attachment.html>


More information about the grass-dev mailing list