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.

I have a large set of rasters in a GRASS mapset, which I would like to use as frames in an animation, visualizing the raster data as elevation. NVIZ is an obvious tool for this, but I'm having trouble getting started. Here's my basic approach so far. I'm starting with grey scale rasters that are actually RGB +alpha where R=G=B. I load one color channel from each raster into nviz as follows:

nviz elevation=file1.tif.blue@default,file2.tif.blue@default,...

This starts up NVIZ as expected for <12 files. With more than 12 files, the first 12 load successfully and then the process fails like this (tail end of log only):

Loading raster map <mean-L1-A1-000011_clipped.tif.blue@default>...
 100%
Translating colors from raster map
<mean-L1-A1-000011_clipped.tif.blue@default>...
 100%
WARNING: Loading data failed
WARNING: Loading data failed
WARNING: Loading data failed
zsh: segmentation fault  nviz

Do you have any idea why this is and how I can fix it? I'll need to load several hundred file at least, to pull off the animation.

EDIT: In the interest of full-disclosure, and because I might be goofing with shell commands, here's what I'm actually entering at the GRASS command line. My original post was intended as a minimal example.

nviz elevation=`cat /Users/gregory/SimData/blue_channel.txt tr '\n' ','`

Where the file blue_channel.txt contains 659 lines has the form:

mean-L1-A1-000000_clipped.tif.blue@default
mean-L1-A1-000001_clipped.tif.blue@default
mean-L1-A1-000002_clipped.tif.blue@default

In order to test cases with different numbers of files as input for the elevation parameter, I'm varying the number of files passed to head in the syntax:

nviz elevation=cat /Users/gregory/SimData/blue_channel.txt | head -10 | tr '\n' ',' | sed -e 's/,$//g'

I've also tested that the problem isn't with specific files (seemed unlikely). For example, nviz does not crash on files 1-10, or 11-20, but it does crash on files 1-20.

share|improve this question
1  
Hint: check the g.mlist manual page for an easier creation of comma separated file name lists (see it in action in grass.osgeo.org/grass64/manuals/r.series.html, EXAMPLES). –  markusN Mar 24 '13 at 20:50
add comment

1 Answer

You are using the "elevation" parameter twice for nviz... Likely you want to use the color parameter. Furthermore, to drape a RGB composite over a DEM, combine the channels first with r.composite and load into NVIZ:

nviz elevation=dem elevation=r_g_b_composite

Example: Screenshot (currently the second there)

By loading the color channels separately, you obtain a stack of maps (R, G, B, ...). If you want to really achieve this, then you need to load the DEM as many times as color images exist:

nviz elevation=dem,dem,dem elevation=r_band,g_band,b_band

which is just a different thing.

Example: Screenshot (currently the first there)

share|improve this answer
    
I goofed; the elevation parameter was not actually used twice (just tried again to be sure). I've corrected that in the post. –  pyrogerg Mar 24 '13 at 13:43
    
I don't think that I want to use the color parameter, as I want to visualize the data in the rasters as an animated time-series of elevation models. There is no real DEM involved (unless you count the rasters that I want to visualize as such). Because R=G=B for all pixels in images, it made sense to me to use a single channel. –  pyrogerg Mar 24 '13 at 13:51
    
Now I get it, yes, at this point you don't want a DEM but use the bands as "elevation" information. –  markusN Mar 24 '13 at 20:38
add comment

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.