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

Hi,

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.

Any hint is welcome..

# my default lat/lon region

g.region -dgp
n=90
s=-90
w=-180
e=180
nsres=0.01666667
ewres=0.01666667
rows=10800
cols=21600

These are my trials:

a) works !

g.region n=90 s=-90 w=0 e=180 -ap
projection: 3 (Latitude-Longitude)
zone: 0
datum: wgs84
ellipsoid: a=6378137 es=0.00669437999014138
north: 90N
south: 90S
west: 0
east: 180E
nsres: 0:00:43.2
ewres: 0:00:43.2
rows: 15000
cols: 15000

b) also works :slight_smile:

g.region res=0:00:41.2 n=90 s=-90 w=0 e=180 -ap

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
...

thanks
  Otto

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.

--
Glynn Clements <glynn@gclements.plus.com>

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