[GRASS-dev] Re: wxNviz toolbar

Helena Mitasova hmitaso at ncsu.edu
Mon Aug 22 09:53:13 EDT 2011


> 
>> 
>> Another issue that does not work very well is fine resolution setting.
>> The original intent was for fine resolution set to 1 to be the resolution of the original raster
>> (later on changed to region resolution which could be set to the rater resolution) 
>> to avoid artifacts in the surface due to nn resampling
>> http://skagit.meas.ncsu.edu/~helena/grasswork/secref_resampling.png
>> When adjusting the 3D view to map display zoom the resolution can get easily higher that the original
>> raster resolution, leading to resampling and then the surface looks like there is a problem 
>> with the data (there used to be lots of artifacts like this in older DEMs).
>> Perhaps a warning should be given to the user that his DEM is resampled and the displayed
>> surface may have artifacts or the 3D view just should not display anything at resolution
>> higher than what the DEM has.
> 
> Good points. I'm still not sure exactly what is happening here though. When you change the computational region to match the display, it changes the region extents but not the region resolution. On the other hand, the display works by keeping the number of pixels constant (for a given window size) regardless of the map zoom/extents. So very large maps are displayed with fewer pixels than cells and a close-up of a region is displayed with more pixels than cells. 
> 
> Is NVIZ registering the display resolution or the region resolution? 
> 
> I've attached a very close up of a section of elevation.dem from Spearfish with nviz resolution set to 1. To me it looks like it is displaying perfectly. This is indeed what the DEM looks like close up in 3D.

not really - when visualized in nviz the grid is converted to TIN and with gouraud shading you should not see squares. 
(without the smooth shading you would see sloped triangles, not flat squares)
When you see squares, your DEM is resampled by nearest neighbor - I have it explained in detail in this lecture
http://courses.ncsu.edu/mea582/common/GIS_anal_lecture/GIS_Anal_Ldata.ppt
see slides 29 and 31, slide 33 explains why you don't always see flat squares (it depends on the relation between the original 
and new resolution).

> But I guess it depends on what we expect to see. Should nviz be smoothing out the cells of the DEM at this scale?
> If so, then it should take the resolution from the region and not from the display.

that is one of the solutions - if taken from region settings, then the user should be in control of the resampling
(of course if he/she actually knows that GRASS does automatic resampling to region resolution).

> *Can* nviz create a smoothed landscape from such a small number of cells at this kind of scale?

as shouwn above, it is not the matter of having small number of cells - you get the squares even for the larger DEMs
if resampling is going on and if the resolution of your screen displays every pixel. And if you do not resample,
with gouraud shading your surface will be smooth even for a small number of cells, it just looks rather fuzzy then.
 (you can try this in old nviz which has the resolution controled by g.region, just make sure your region is set to the 
DEM that you are displaying.).

> With respect to horizontal extent, it is very nice to have nviz finally display in 3D what I'm seeing in 2D. So I like it that wxNVIZ is using the display to define the horizontal extent of the 3D display.

yes, I like that too.

> I'm not sure how best to deal with the resolution issue.

avoiding the nn resampling should fix it, although I am not sure how difficult that would be. 
Another option would be to do bilinear interpolation when resampling FP continuous field maps 
(but we can have FP maps that are not continuous fields where interpolation is not appropriate).

Helena
> 
> <nviztest.jpg><ATT00001..txt>



More information about the grass-dev mailing list