1

I have a problem related with this question (Old question without answer: R.Neighbors with large neighborhoods?).

Basically, I want to estimate roughness of a given area, for which I was using QGIS, but I want to change the neigborhood size, so I'm using GRASS now because I didn't find a way to do that in QGIS. I am working with ASTER GDEM v2.

So I want to explore a circular neighborhood of aprox. 500m around each pixel and, since each pixel of ASTER GDEM v2 has aprox. 30m of width, I believe my neighborhood size should be of 17, right?

I selected "use circular neighborhood" and for method "average". The program runs and creates a new layer but then I cannot open the raster file. The "Map Display" shows a blank screen when I perform "zoom to selected maps" of the result layer. I tried to save the file as .tiff and open it in QGIS but I obtain, again, a blank screen, and the raster has no values (nan-nan).

Can someone help me please? I don't know if this problem is related with the parameters I am using or if it is related with the software!

UPDATE: After running r.info, I got this: enter image description here

  • 1
    Please run r.info on the resulting map for a start to check the metadata (you may then edit your posting and add relevant information printed by r.info) – markusN May 25 '16 at 17:57
  • That is now in the post! However I can't seem to find any problem there but I am new at GRASS. Do you see anything strange? – Teresa May 25 '16 at 20:27
  • 1
    Strange yes: the range is NAN which is no good. Means: no data there. Did you set the computational reagion first to the map? "g.region raster=ASTGTM2_N42W002_dem@Acer -p" ...this then followed by the r.neighbors command. – markusN May 25 '16 at 20:36
  • 1
    I did that and it solved the problem! I am able to open the raster now, in GRAS and QGIS as well!! Thank you very much for your time and help! – Teresa May 25 '16 at 21:49
  • You are most welcome. I'll turn my comment into an answer. – markusN Jun 9 '16 at 13:03
1

The fact that the range is NAN is no good as it means: no data there :)

In GRASS GIS, the concept of computational region applies, i.e. in computations, raster input maps are automatically cropped/padded and rescaled (using nearest neighbour resampling) to match the actual computational region (bounding box and current raster resolution) in order to produce the output raster map or to query values. Subsequently, raster maps created through a computation in a GRASS GIS session have their bounds and resolution equal to those of the actual computational region. The advantage is that you can do quick computations in a sub-region even when the input maps are huge.

You will have to set the computational region first to the raster map to consider it completely at its native resolution:

g.region raster=ASTGTM2_N42W002_dem -p

and this then followed by the computation (in your case the "r.neighbors" command).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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