Opened 15 years ago

Closed 12 years ago

#912 closed defect (fixed)

r3.mapcalc depth() and z() function upside down

Reported by: ayepri Owned by: grass-dev@…
Priority: normal Milestone: 6.4.0
Component: Default Version: unspecified
Keywords: Cc:
CPU: Unspecified Platform: All

Description

# computation of a 3d raster with z values from the z() function r3.mapcalc Z='z()' # export to VTK format (see attached image grid_inversed_z.png) r3.out.vtk Z output=./Z_3dg.vtk

In r3.mapcalc, z() function returns -z, and depth() function returns the elevation of the cell. On the grid_inversed_z.png (viewed in Paraview), one can note that higher Z values are at the bottom of the grid (mind the axis at the bottom left). mputed z() isosurfaces are not horizontal (see grid_inversed_deformed_z)

Attachments (2)

grid_inversed_deformed_z.png (35.4 KB ) - added by ayepri 15 years ago.
volume filled with z() values from r3.mapcalc and visualized with Paraview
r3mapclac_paraview_z_coordinate.png (6.8 KB ) - added by huhabla 12 years ago.

Download all attachments as: .zip

Change History (3)

by ayepri, 15 years ago

volume filled with z() values from r3.mapcalc and visualized with Paraview

comment:1 by huhabla, 12 years ago

Platform: MacOSXAll
Resolution: fixed
Status: newclosed

This issue should be fixed in trunk r52769, 6.4.svn r52771 and 6.5.svn r52772. Now the z-coordinate is computed from bottom to the top.

Example:

GRASS 7.0.svn (TestLL):~ > g.region b=0 t=100 n=90 s=-90 e=180 w=-180 res3=20 res=20 -p3 
projection: 3 (Latitude-Longitude)
zone:       0
datum:      wgs84
ellipsoid:  wgs84
north:      90N
south:      90S
west:       180W
east:       180E
top:        100.00000000
bottom:     0.00000000
nsres:      20
nsres3:     20
ewres:      20
ewres3:     20
tbres:      20
rows:       9
rows3:      9
cols:       18
cols3:      18
depths:     5
cells:      162
cells3:     810
GRASS 7.0.svn (TestLL):~ > r3.mapcalc  expr="test = z()" --o
 100%
GRASS 7.0.svn (TestLL):~ > r3.out.vtk input=test output=/tmp/test.vtk --o && paraview --data=/tmp/test.vtk
 100%

Result see attachment: r3mapclac_paraview_z_coordinate.png

Note: See TracTickets for help on using tickets.