Skip to content

Raster mask query troubleshooting #216

@knutole

Description

@knutole

Elimination

  • 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.
  • 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.
    screen shot 2016-06-03 at 09 04 17
  • Include correct values in calculation. Values 100-200 are included, which has been thrice confirmed by Eirik.
  • Use float numbers. Still same results.
  • 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; 
  • 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.
    screen shot 2016-06-03 at 10 06 48
  • 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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions