[GRASS-dev] [GRASS GIS] #167: g.region: reports wrong center
longitude and LL bounding box
GRASS GIS
trac at osgeo.org
Wed May 14 03:36:14 EDT 2008
#167: g.region: reports wrong center longitude and LL bounding box
--------------------------+-------------------------------------------------
Reporter: hamish | Owner: grass-dev at lists.osgeo.org
Type: defect | Status: new
Priority: major | Milestone: 6.4.0
Component: default | Version: svn-develbranch6
Keywords: g.region 180 |
--------------------------+-------------------------------------------------
Hi,
if you set up a region which crosses 180 longitude, g.region -b and -l
have problems calculating the center coord:
create a new location using EPSG 3112. (Australia; Lambert CC)
{{{
g.region n=1973000 s=-6188000 w=-5175000 e=4846000 res=1000
d.mon x0; d.grid -g 10
# looks ok, if you ignore that grid lines E of 180 are missing
}}}
---
{{{
g.region -b # print max LL bounding box (WGS84)
north longitude: 19:37:06.913074N
south longitude: 44:19:08.88403S
west latitude: 69:34:08.058065E
east latitude: 168:13:13.623433E
center latitude: 118:53:40.840749E
center longitude: 12:21:00.985478S
}}}
/general/g.region/printwindow.c:
* lat/lon swapped; "north longitude" -> "North latitude" etc.
after fixing that, the max bounding box calc still is wrong.
furthest east is the bottom right corner (165W) but -b reports the value
at the top right (168E). [simple a>b test too simple?]
That eastern boundary value is used for the center lon calc, so the center
lon is wrong as well (skewed to the west).
---
{{{
g.region -l # print lat/lon (current ellipsoid)
north-west corner: long: 97:34:49.670961E lat: 20:13:08.52602N
north-east corner: long: 168:13:13.623433E lat: 19:37:06.913074N
south-east corner: long: 165:02:10.589072W lat: 44:19:08.88403S
south-west corner: long: 69:34:08.058065E lat: 42:56:48.735964S
center longitude: 42:35:00.190847E
center latitude: 11:51:25.545225S
rows: 8161
cols: 10021
}}}
this time it gets the box corners correct but the center longitude is
wrong. it's looking around the wrong side of the world and the answer is
apparently 180deg out.
also note the center lat is different to the -b version, and that with -l
the NW corner's lat is bigger than the NE lat, but for -b max bounding box
the more southerly 19:37N is used, not the further out 20:13N.
Hamish
--
Ticket URL: <http://trac.osgeo.org/grass/ticket/167>
GRASS GIS <http://grass.osgeo.org>
More information about the grass-dev
mailing list