[GRASS-dev] v.rast.stats fails with column_prefix='t'
Anna Petrášová
kratochanna at gmail.com
Fri Nov 20 06:59:53 PST 2015
On Fri, Nov 20, 2015 at 4:17 AM, Nikos Alexandris <nik at nikosalexandris.net>
wrote:
> * Anna Petrášová <kratochanna at gmail.com> [2015-11-20 00:10:19 -0500]:
>
> > On Thu, Nov 19, 2015 at 2:53 PM, Nikos Alexandris <
> nik at nikosalexandris.net>
> > wrote:
> >
> > > Nikos:
> > >
> > > > > The command
> > > > > v.rast.stats map=SomeVector raster=SomeRaster column='t'
> > > > > fails. Perhaps the line
> > >
> > > Anna:
> > >
> > > > How exactly does it fail?
> > >
> > > --%<---
> > > v.info -c Test
> > > INTEGER|cat
> > > INTEGER|Id
> > > CHARACTER|Name
> > >
> > > v.rast.stats map=Test raster=LT51960282005221KIS00_B1 column='t'
> > > Traceback (most recent call last):
> > > File
> > > "/osgeo/grass70/dist.x86_64-unknown-linux-gnu/scripts/v.rast.stats",
> line
> > > 306, in <module>
> > > main()
> > > File
> > > "/osgeo/grass70/dist.x86_64-unknown-linux-gnu/scripts/v.rast.stats",
> line
> > > 268, in main
> > > i = variables[variable]
> > > KeyError: 'firsquartile'
> > > --->%--
> > >
> > > Strange, however, it does not fail always!?
> > >
> > > Another example
> > >
> > > --%<---
> > > v.info -c test
> > > INTEGER|cat
> > >
> > > v.rast.stats map=test raster=test column_prefix='t'
> > > --->%--
> > >
> > > seems to work and gives
> > >
> > > DOUBLE PRECISION|t_number
> > > DOUBLE PRECISION|t_minimum
> > > DOUBLE PRECISION|t_maximum
> > > DOUBLE PRECISION|t_range
> > > DOUBLE PRECISION|t_average
> > > DOUBLE PRECISION|t_stddev
> > > DOUBLE PRECISION|t_variance
> > > DOUBLE PRECISION|t_coeff_va
> > > DOUBLE PRECISION|t_sum
> > > DOUBLE PRECISION|t_first_qu
> > > DOUBLE PRECISION|t_median
> > > DOUBLE PRECISION|t_third_qu
> > > DOUBLE PRECISION|t_per90
> > >
> > > Nikos
> > >
> > >
> > >
> >
> > Should be fixed in 66864. I still don't understand why it doesn't fail in
> > the other case though.
>
> Need to look closer -- no time. Yet, why use .replace for adding a prefix?
>
At that point is actually removing the prefix. There is a better way to
fix it, but this was quick and easy fix, hopefully effective.
Anna
>
> Nikos
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20151120/3e8b0f70/attachment-0001.html>
More information about the grass-dev
mailing list