[GRASSLIST:10277] Re: problem to adjust a lat/lon region

Otto Dassau dassau at gdf-hannover.de
Mon Feb 13 12:00:02 EST 2006


Am Montag, 13. Februar 2006 16:35 schrieb Glynn Clements:
> Otto Dassau wrote:
> > I would like to adjust a lat/lon region with g.region, but is doesn't
> > seem to work and behaves strange and/or I probably don't know how to make
> > it right.
> >
> > What I am trying to get is a region with 16200 cols and rows within
> > n=90, s=-90, w=0 and e=180.
> >
> > c) does not work, but I do not know why.
> >
> > g.region res=0:00:41.1 n=90 s=-90 w=0 e=180 -ap
> > ERROR: Invalid region: Illegal latitude for North
> > g.region res=0:00:41 n=90 s=-90 w=0 e=180 -ap
> > ERROR: Invalid region: Illegal latitude for North
>
> The test makes no allowance for rounding error; if the aligned north
> value is 90.0000000001, you will get an error.
>
> You could try using e.g. 89.9999999 for the north/south values to
> avoid this issue.

you were right - thanks a lot!

gdalinfo told me that upper and lower right is > 90:
Upper Left  (  -0.0055556,  89.9055556)
Lower Left  (  -0.0055556, -90.0944444)
Upper Right ( 179.9944444,  89.9055556)
Lower Right ( 179.9944444, -90.0944444)
Center      (  89.9944444,  -0.0944444)

I changed this with gdalwarp and it is working fine now.

gdalwarp -s_srs EPSG:4326 -te 0 -90 180 90 -t_srs EPSG:4326 input.tif
output.tif

regards,
  Otto




More information about the grass-user mailing list