[GRASSLIST:5699] Re: r.in.gdal problem?
Glynn Clements
glynn.clements at virgin.net
Fri Feb 28 15:39:35 EST 2003
David Orme wrote:
> I'm using the r.in.gdal module to import ARCINFO GRID format raster
> files and I seem to be getting a shift in the extent of the data on
> import:
>
> The files contain 1 by 1 degree resolution raster data. In Arc, the NS
> extent of the raster data is:
>
> bottom edge of southernmost grid square = 90S
> topmost edge of northernmost square = 77N
>
> The raster therefore contains 167 rows of data.
>
> When I import this, the file extent is as follows:
> > | Projection: UTM (zone 13) |
> > | N: 77.5 S: -89.5 Res: 1 |
> > | E: 330.5 W: -226.5 Res: 1 |
> The number of rows (and columns) are correct but the extent is peculiar
> - I'm guessing that r.info returns the centre points of the grid cells
> but if this is the case then the centre of the northernmost cell should
> be at 76.5N not 77.5N. This also makes the reported southern extent
> odd since the 89.5 S implies that there is still a gridsquare that has
> 90S as a bottom edge. Using d.where to inspect the location visually
> shows that the top of the northernmost cell in grass is now at 78N and
> the bottom of the lowermost cell is at 89S.
>
> Something doesn't add up - I'm expecting to find that it may be me but
> can anyone clear this up?
The GRASS region refers to cell corners, not centres; it seems that
r.in.gdal is misinterpreting the region information in the grid file.
You can fix the resulting map manually using r.region, e.g.
r.region map=... n=77 s=-90 ...
However, you appear to have imported the data into a UTM location,
when the data is actually lat/lon.
--
Glynn Clements <glynn.clements at virgin.net>
More information about the grass-user
mailing list