[GRASS-user] v.what.rast sampling cells 5 km to east

Michael Spencer spencer.mike.r at gmail.com
Wed Jul 10 07:05:54 PDT 2013


Hi Markus,

Good idea. I've downloaded the NC dataset and tried it using the following
commands (resizing the region to save time):

g.region res=30
g.region n=228500 s=228000 e=630500 w=630000
r.to.vect --overwrite
input=elev_srtm_30m at PERMANENToutput=elev_srtm_30m_vec feature=point
v.db.addcol map=elev_srtm_30m_vec at user1 columns=srtm double precision
v.what.rast vector=elev_srtm_30m_vec at user1
raster=elev_srtm_30m at PERMANENTcolumn=srtm

Checking just the NW corner, I'm getting the right results, so the issue
doesn't appear to be with v.what.rast. Are there any issues with importing
ascii grids or shape files that could cause this?

My example dataset is available
here<http://ubuntuone.com/24Gb4JLTlXO2JHPPTj5GCQ>,
made up of a shp file of points and an ascii raster and also these imported
into a grass location and mapset. The commands I used are as follows:

r.in.arc input=/home/filepath/MeanTemp_Apr_1961-1990_LTA.txt output=Temp_apr
v.in.ogr -o dsn=/home/filepath/MO_grid_pts_GB.shp output=MO_grid_pts_GB
v.db.addcol map=MO_grid_pts_GB at PE columns=apr double precision
v.what.rast vector=MO_grid_pts_GB at PE raster=Temp_apr at PE column=apr

When I then use the query raster/vector maps tool in the map display at,
for example, grid ref 142500,962500 (top of the Western Isles) and the two
points to the east I find the vector data attribute is taken from the
raster cell 5 km to the east. As a quick check, this is the same in
Edinburgh too.

Help greatly appreciated!
Michael


On 10 July 2013 00:56, Markus Neteler <neteler at osgeo.org> wrote:

> Michael,
>
> On Mon, Jul 8, 2013 at 6:43 PM, Michael Spencer
> <spencer.mike.r at gmail.com> wrote:
> > Hi,
> >
> > I've a problem with the v.what.rast tool. I imported a vector grid of
> points
> > with a spacing of 5 km (v.in.ogr) to GRASS, along with 12 rasters
> > (r.in.arc). There is a point in the centre of each raster cell, with some
> > extra points as a buffer around the edge (still on a 5 km grid).
> >
> > Having added extra columns to the point vector file I ran v.what.rast to
> > extract the value of the 12 rasters, in turn, at each point location.
> >
> > Checking the result in the GRASS viewer the tool has appended data from
> the
> > raster cell 5 km to the east at all locations.
> >
> > Is this a bug? Has anyone else experienced it? And most importantly -
> does
> > anyone know how to fix it?!
>
> We would need an example with e.g. the North Carolina sample dataset to
> easily reproduce (or not) the issue:
>
> http://grass.osgeo.org/download/sample-data/
>
> Markus
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20130710/e2ab747e/attachment.html>


More information about the grass-user mailing list