[GRASS5] LatLong E/W problem in southern hemisphere

Roger Bivand Roger.Bivand at nhh.no
Fri Oct 15 12:53:39 EDT 2004


On Fri, 15 Oct 2004, Markus Neteler wrote:

> On Fri, Oct 15, 2004 at 06:30:40PM +0200, Roger Bivand wrote:
> > On Fri, 15 Oct 2004, Markus Neteler wrote:
> > 
> > > Hi,
> > > 
> > > we have a map in LatLong, located somewhere in Argentina:
> > > 
> > > g.region rast=noaa -p
> > > projection: 3 (Latitude-Longitude)
> > > zone:       0
> > > datum:      wgs84
> > > ellipsoid:  a=6378137 es=0.00669438
> > > north:      30:24S
> > > south:      35:42:00.0036S
> > > west:       58:17:59.9964W
> > > east:       65:11:59.9892W        <- note this correct value
> > 
> > Just asking: does Southern hemisphere mean we look at things upside down? 
> > Shouldn't east be (yes) east of west, this east is almost 7 degrees west 
> > of west, and I think the algorithm is (logically) assuming that you want 
> > what is asked for, 353 degrees? Or am I missing something (I wouldn't be 
> > surprised!)? Maybe a warning could be useful when the nsres/ewres ratio is 
> > so extreme?
> 
> Roger, the problem (to me) is that above we have the expected value
> 65:11:59.9892W, which becomes later 294.800003 
> (360 - 294.800003 = 65.2 !). So the wrap around doesn't work (or whatever).
> 

Why is the declared east west of west? Isn't the program just doing what 
it was asked to do? It seems to say that, well, if the stated east is west 
of west *in lat-long* this can be resolved by going round the other way, 
which it then does. Isn't this an input error? 

east=-65.199997 west=-58.299999

west=           east=

seems more likely? I don't think it's the code, I think it's doing what it 
was told?

Roger

>  
> GRASS 5.7.cvs > g.region -g
> > > n=-30.4
> > > s=-35.700001
> > > w=-58.299999
> > > e=294.800003          <- note the wrong value
> > > nsres=0.06309525
> > > ewres=4.70800003
> > > 
> > > The bug seems to be somewhere in libgis, because:
> > > 
> > > r.in.bin ~/pub/avhrrpf.ndvi.1ntfsa.840101.11705583 output=noaa bytes=1 north=-30.400000  south=-35.700001  east=-65.199997 west=-58.299999 rows=84 cols=75
> > > D0/0: E: 294.800003  N:-58.299999
> > > D0/0: E: 294.800003  N:-58.299999
> > > D0/0: E: 294.800003  N:-58.299999
> > > Percent Complete:  100%
> > > CREATING SUPPORT FILES FOR noaa
> > > 
> > > I have added the debug output to
> > > lib/gis/adj_cellhd.c
> > > (line 103)
> > >    G_debug(0,"E: %f  N:%F",cellhd->east,cellhd->west);
> > > 
> > > Anyone working in the southern hemisphere and observing similar
> > > problems?
> 
> If east remained -65.199997 instead of becoming 294.800003, everything would
> be ok and the test for East > West would work as well.
> 
> Markus
> 
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: Roger.Bivand at nhh.no





More information about the grass-dev mailing list