[GRASS-user] Correct import of a global grid (0E to 360E) to GRASS (-180W to 180E).

Michael wrote:

Which way does it get flipped?

Most NetCDF files will import via r.in.gdal correctly, but they
are displayed as (from L->R) as 0->180E/180W->0. This is the way
that most climate model files are created and then stored.

note I've had some data in the past which either had bad meta-
data embedded in it or GDAL was reading wrong. GRASS itself should
deal with 0-360 longitudes just fine for raster maps. But if the
import goes wrong for whatever reason it is easy to fix by
resetting the bounds with r.region.

This presents some problems in displaying vector overlays (I've
reported this to the bug tracker).

note the vector lib and modules not nearly as robust wrt 180
longitude as the raster lib & modules are. mostly a function of
age I guess.

There has been a problem in NetCDF files importing upside down.
This fixed in the current version of GDAL AFAICT.

Right, you can work around that one with the r.flip addon module.

Hamish

Michael wrote:

Which way does it get flipped?

Most NetCDF files will import via r.in.gdal correctly, but they
are displayed as (from L->R) as 0->180E/180W->0. This is the way
that most climate model files are created and then stored.

It’s not a climate model, but that’s exactly the way it gets flipped.

Hamish wrote:

note I’ve had some data in the past which either had bad meta-
data embedded in it or GDAL was reading wrong. GRASS itself should
deal with 0-360 longitudes just fine for raster maps. But if the
import goes wrong for whatever reason it is easy to fix by
resetting the bounds with r.region.

Thanks a lot, that solved it. Believe it or not I never used r.region,
so it didn’t come into my mind: Simply doing:

r.region map=mymap e=180 w=-180

did the trick. Thanks again.

Best regards,
Marcello.