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

Markus Metz markus.metz.giswork at gmail.com
Thu Jul 11 01:34:45 PDT 2013


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.

It seems that the current region is not properly aligned to the raster
and instead shifted by exactly half a cell in east-west direction,
which would explain the observed results. Try to run g.region -p
align=<raster_to_query> before using v.what.rast.

HTH,

Markus M

>
> Is this a bug? Has anyone else experienced it? And most importantly - does
> anyone know how to fix it?!
>
> Ta,
> Michael
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>


More information about the grass-user mailing list