[GRASS-user] issues with netCDF import

Hamish hamish_b at yahoo.com
Sat Mar 22 02:21:58 PDT 2014


Damian wrote:

...
>>  Origin = (-180.000000000000000,90.000000000000000)
>>  Pixel Size = (0.008333333767951,-0.008333333767951)
...
>>  Corner Coordinates:
>>  Upper Left  (-180.0000000,  90.0000000)
>>  Lower Left  (-180.0000000, -90.0000094)
>>  Upper Right ( 180.0000188,  90.0000000)
>>  Lower Right ( 180.0000188, -90.0000094)
>>  Center      (   0.0000094,  -0.0000047)

Moritz:
> Try running r.in.gdal with the -l flag to force fit within -180,180.

technically it's the illegal >90 deg latitude it is unhappy with, GRASS's raster engine can deal with wrapping around 180 longitude (0-360 is supported too). keep an eye on g.region, sometimes minor +/- adjustments are needed to tell it which way to go around the world, the long way or the (very) short way!

In this case it looks like simple cumulative rounding error because 'Pixel Size' got cast to single precision floating point somewhere along the way (3's don't repeat to infinity as they should), and as Moritz explains, 'r.in.gdal -l' will fix it.


In other cases where the convention is grid-centered not cell-centered you get half a cell of overlap at the poles and it's a bit uglier to clean up. (note to self: need to work on a script to handle that automatically; see r.in.srtm)

see also http://grasswiki.osgeo.org/wiki/NetCDF


regards,
Hamish



More information about the grass-user mailing list