[GRASS5] d.what.rast & quantization

Roger Bivand Roger.Bivand at nhh.no
Mon Feb 28 02:48:15 EST 2005


On Sun, 27 Feb 2005, Markus Neteler wrote:

> On Sun, Feb 27, 2005 at 05:19:50PM -0500, Helena wrote:
> > Markus,
> > 
> > is elev the result of v.surf.rst (or s.surf.rst)?
> > If yes, this seems to be rst problem - Susane Rizzolli has already reported 
> > it.
> 
> Ah, didn't know that. Yes, it's v.surf.rst from current CVS.
> Thanks for your quick reply.
> 
> > If you multiply the result by 1.0 in r.mapcalc, the quant is recomputed
> > and the result of query is correct.
> > 
> > rst calls quantize here - I did not have time to look at what quantize
> > actually does  and why are the min and max values done like this,
> > rst was updated for FP support while FP support was still under development
> > so quant might have changed and this is now producing wrong result.
> > G_quantize_fp_map_range (params->elev, mapset,
> >                              (DCELL) zminac - 0.5, (DCELL) zmaxac + 0.5,
> >                            (CELL) (zminac - 0.5), (CELL) (zmaxac + 0.5));
> > It might have been there for years, but nobody is probably using the quant 
> > result, so there were no compliants
> 
> Would be nice to get it fixed. Maybe Glynn with his insights has
> a suggestion?

There is code in src/rastput.c (after line 160) and R/rast.put.R (after
line 39) in the R GRASS package that puts quantization in place for layers
being written to GRASS. The default is to use about 20 "pretty" intervals,
but other schemes can be imposed by the user. I seem to remember that
setting it up was not as simple as I had expected. Getting the colours and 
interval labels right seemed to matter - since nobody has complained since 
2003, I guess it isn't too badly broken (on 5.4).

Roger

> 
> Markus
> 
> 
> > Helena
> > 
> > 
> > Markus Neteler wrote:
> > >Hi,
> > >
> > >looking at d.what.rast, I see output like this:
> > >
> > >d.what.rast
> > >
> > >Buttons
> > > Left:  what's here
> > > Right: quit
> > >
> > >278786.03515625(E) 5232741.95078125(N)
> > >elev in PERMANENT, quant   (447)
> > >elev in PERMANENT, actual  (447.190521)
> > >
> > >279031.25390625(E) 5233060.73515625(N)
> > >elev in 5(E) 5232741.95078125(N)
> > >elev in PERMANENT, quant   (447)
> > >elev in PERMANENT, actual  (447.190521)
> > >
> > >279031.25390625(E) 5233060.73515625(N)
> > >elev in PERMANENT, quant   (539)
> > >elev in PERMANENT, actual  (540.034363)
> > >
> > >278700.20859375(E) 5235660.05390625(N)
> > >elev in PERMANENT, quant   (-557)
> > >elev in PERMANENT, actual  (-558.007324)
> > >
> > >The quantization rule is not obvious to me, what's the
> > >background to get such results?
> > >
> > >Thanks
> > >
> 
> _______________________________________________
> grass5 mailing list
> grass5 at grass.itc.it
> http://grass.itc.it/mailman/listinfo/grass5
> 

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