[GRASS-dev] [GRASS GIS] #1599: netcdf input upside down raster

GRASS GIS trac at osgeo.org
Tue Mar 6 12:43:36 EST 2012


#1599: netcdf input upside down raster
---------------------------------------------+------------------------------
 Reporter:  michpaulatto                     |       Owner:  grass-dev@…              
     Type:  defect                           |      Status:  new                      
 Priority:  normal                           |   Milestone:                           
Component:  Raster                           |     Version:  6.4.0                    
 Keywords:  input netcdf upside down raster  |    Platform:  Linux                    
      Cpu:  x86-64                           |  
---------------------------------------------+------------------------------
 What I'm trying to do: I'm importing netcdf elevation and/or gravity grids
 (.grd) into grass.

 The problem: imported raster is sometimes upside down

 Example: two netcdf grid files generated with GMT's grdsample. dem.grd and
 grav.grd, see below output of grdinfo:

 % grdinfo dem.grd [[BR]]
  dem.grd: Title: dem.grd[[BR]]
  dem.grd: Command: grdsample -R173/193/-39/-15 -I0.02 Complete_merged.grd
 -Gdem.grd[[BR]]
  dem.grd: Remark:[[BR]]
  dem.grd: Gridline node registration used[[BR]]
  dem.grd: Grid file format: nf (# 18) GMT netCDF format (float)  (COARDS-
 compliant) [DEFAULT] [[BR]]
  dem.grd: x_min: 173 x_max: 193 x_inc: 0.02 name: longitude [degrees_east]
 nx: 1001[[BR]]
  dem.grd: y_min: -39 y_max: -15 y_inc: 0.02 name: latitude [degrees_north]
 ny: 1201[[BR]]
  dem.grd: z_min: -10804.1416016 z_max: 714.619628906 name: z[[BR]]
  dem.grd: scale_factor: 1 add_offset: 0[[BR]]

 % grdinfo grav.grd [[BR]]
  grav.grd: Title: grav.grd[[BR]]
  grav.grd: Command: grdsample -R173/193/-39/-15 -I0.1 temp
 -Ggrav.grd[[BR]]
  grav.grd: Remark: [[BR]]
  grav.grd: Gridline node registration used[[BR]]
  grav.grd: Grid file format: nf (# 18) GMT netCDF format (float)  (COARDS-
 compliant) [DEFAULT] [[BR]]
  grav.grd: x_min: 173 x_max: 193 x_inc: 0.1 name: x nx: 201[[BR]]
  grav.grd: y_min: -39 y_max: -15 y_inc: 0.1 name: y ny: 241[[BR]]
  grav.grd: z_min: -270.356201172 z_max: 203.824752808 name: z[[BR]]
  grav.grd: scale_factor: 1 add_offset: 0[[BR]]

 When I import these two files into grass (from the GUI) dem.grd results in
 a correct raster while grav.grd results in an upside down raster. This
 happens with other grd files I've tried, but this example is quite
 interesting since the two grd files cover the same area, have the same
 dimensions and have been generated in exactly the same way. They have
 different grid spacing. Any clues?

 Thanks. Michele.

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/1599>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list