[x] Correct SRID of raster. The raster is in correct SRID. Vector mask is transformed correctly from 4326 to 3857, and vector- and raster mask yield same result. Also, all rasters are gdal_transformed to SRID 3857 on import.
[ ] Correct pixel scale of raster. The x scale differ between the mask and the snow-rasters.
[x] Calculation. Adding the SCF_0.tif, SCF_160.tif, SCF_200.tif yield correct graph calculations of respectively 0%, 60%, 100%, which means there's nothing wrong with the calc method itself.
[x] Include correct values in calculation. Values 100-200 are included, which has been thrice confirmed by Eirik.
[x] Use float numbers. Still same results.
[x] Confirm correct query: select row_to_json(t) from (SELECT A.rid, pvc FROM ' + dataset.table_name + ' AS A, ' + mask_dataset_id + ' AS B, ST_ValueCount(A.rast,1) AS pvc WHERE st_intersects(A.rast, 1, B.rast, 1)) as t;
[x] IMPROVEMENT: Only use part of mask which have values > 0.
Darkest red line is with 0 values of mask excluded, which in fact is an improvement. This shows that there indeed was something wrong with the mask (the whole raster mask was used). There is likely secondary error-sources at work here also.
[ ] Vannmaske. Count the 20 values...
Suspicions
The difference between G—/Systemapic calcs is the least when there's most snow (ref. 20th Jan).
If the mask was faulty (say, wrong SRID), then this would have the least effect when there's a lot of snow (with coverage going all the say to the coast, for example, and lots of area being 100%).
So this perhaps indicates that there's something wrong - not with the calculation - but with the mask (or the watermask, perhaps).
Elimination
SRID
of raster. The raster is in correctSRID
. Vector mask is transformed correctly from4326
to3857
, and vector- and raster mask yield same result. Also, all rasters aregdal_transformed
toSRID 3857
on import.pixel scale
of raster. The x scale differ between the mask and the snow-rasters.SCF_0.tif, SCF_160.tif, SCF_200.tif
yield correct graph calculations of respectively0%, 60%, 100%
, which means there's nothing wrong with the calc method itself.100-200
are included, which has been thrice confirmed by Eirik.float
numbers. Still same results.select row_to_json(t) from (SELECT A.rid, pvc FROM ' + dataset.table_name + ' AS A, ' + mask_dataset_id + ' AS B, ST_ValueCount(A.rast,1) AS pvc WHERE st_intersects(A.rast, 1, B.rast, 1)) as t;
0
values of mask excluded, which in fact is an improvement. This shows that there indeed was something wrong with the mask (the whole raster mask was used). There is likely secondary error-sources at work here also.Suspicions
The difference between G—/Systemapic calcs is the least when there's most snow (ref. 20th Jan).