[GRASS-user] how to create a voxel

Hamish hamish_nospam at yahoo.com
Tue Oct 10 00:31:10 EDT 2006


> > Michaël Rabotin wrote:
> > > I'm on GRASS 6.01 on Ubuntu and I want to create a voxel (raster
> > > 3D ) by the command r3.in.ascii.
> > > I've got an error message after running my command :
> > > r3.in.ascii input=/home/rabotin/svg-roujan/test-roujan/mnt3d.asc
> > > output=mnt3d
> > > FATAL ERROR: asciiToG3d: read failed
> > >
> > > I think I've got a probleme with my input text file. Is anybody
> > > can say to me what is the problem:
> > >
> > > Extract of my Input text file:
> > >
> > > north: 133032.28
> > > south: 132988.28
> > > east: 678769.63
> > > west: 678725.63
> > > top: 153
> > > bottom: 132
> > > rows: 22
> > > cols: 22
> > > levels: 1
> > > 678726.63,133031.28,143 678728.63,133031.28,143
> > > 678730.63,133031.28,141 .......
> > > 678728.63,133029.28,142 678730.63,133029.28,141
> > > 678732.63,133029.28,140
> > ....
> > > and so on, with 22 rows and 22 columns
HB:
> > can you send a small test file?
MR:
> ok I send you a little asc file
> it seems ok when I use r3.in.ascii but I've got an empty voxel


For me that data works fine.

G63> r3.in.ascii in=mnt3.asc out=mnt3
rows=22 cols=22 depths=1

G63> r3.info mnt3
...
 |----------------------------------------------------------------------------|
 |                                                                            |
 |   Type of Map:  3d cell              Number of Categories: 0               |
 |   Data Type:    double                                                     |
 |   Rows:         22                                                         |
 |   Columns:      22                                                         |
 |   Depths:       1                                                          |
 |   Total Cells:  484                                                        |
 |        Projection: x,y (zone 0)                                            |
 |            N:  133032.28    S:  132988.28   Res:     2                     |
 |            E:  678769.63    W:  678725.63   Res:     2                     |
 |            T:        153    B:        132   Res:    21                     |
 |   Range of data:   min =        132 max =        153                       |
...

looks good.

G63> g.region rast3d=mnt3
G63> g.region -p
projection: 0 (x,y)
zone:       0
north:      133032.28
south:      132988.28
west:       678725.63
east:       678769.63
nsres:      2
ewres:      2
rows:       22
cols:       22
cells:      484


I didn't have any luck displaying it with NVIZ, but it's only one layer
thick so I wasn't expecting much(?)
 [bug: need to start with "nviz -q" then add new volume and isosurface]

but this works:
G63> r3.to.rast in=mnt3 out=mnt2
G63> d.rast mnt2


?,
Hamish




More information about the grass-user mailing list