Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Or have I completely misunderstood something now? As a programmer I took it for granted that the row number would change if I traversed the map up and down in the program along the North-South axis while the columns would change when I traversed the map sideways from west to east. In the raster, the (0,0) coordinate would represent the north-western-most cell, with values increasing towards the south-east.

And this fact seems supported by the following line taken from init_vars.c:

max_length = 10 * nrows * window.ns_res + 10 * ncols * window.ew_res;

But then I found this in the code for calculating the length of the slope for a given cell in slope_len.c:

if (r == dr)
    res = window.ns_res;
else if (c == dc)
    res = window.ew_res;
else
    res = diag;

if (top_ls == half_res) // half_res = initialization value
    top_ls = res;
else
    top_ls += res;

Here we are dealing with a cell given by coordinates (r,c) which flows into another cell (dr,dc). So the code reads to me that if the two cells are on the same row, add to the slope the map's North-South resolution. Should it not be West-East since the slope is horizontal rather than vertical and vice versa for the columns?

Either I misunderstand how the length is calculated or this seems like a bug in the program for me. Also on quadratic cell sizes this will not be noticeable but it is important that I get it right for other cases.

share|improve this question
1  
Please tell us which GRASS version you are looking at. Furthermore, let me recommend the grass-dev mailing list for the question (grass.osgeo.org/support/mailing-lists) –  markusN Apr 3 '13 at 16:55
    
6.4.2 Stable Release. This code is still present in the latest Grass 7 snapshot created last Sunday. –  Steinin Apr 4 '13 at 6:24
    
OK, so please contact either the author or better, the indicated developers mailing list... –  markusN Apr 4 '13 at 16:09
    
I've sent this question to the GRASS Developers mailing list. –  Steinin Apr 5 '13 at 10:01
    
Actually I don't see it: lists.osgeo.org/pipermail/grass-dev/2013-April/date.html Note that you need to subscribe to post there... (to avoid spam messages). –  markusN Apr 5 '13 at 18:33

1 Answer 1

up vote 0 down vote accepted

Confirmed as bug and fixed by developers in new version.

share|improve this answer
    
For the record: trac.osgeo.org/grass/changeset/55666 –  markusN Apr 8 '13 at 19:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.