[GRASS5] raster inaccuracy

Glynn Clements glynn at gclements.plus.com
Thu Nov 11 11:34:19 EST 2004

Roger Miller wrote:

> I put together several examples that can be had from
> http://members.spinn.net/~roger/example.tgz
> The tar file produces a GRASS XY location named "example."  The examples are
> in the PERMANENT map set.
> Here is the step-by-step procedure:
> copy the tar file to our Grass data file hierarchy and unarchive the file
> start Grass, using location "example" and mapset "PERMANENT"
> "g.list vect" should list 6 vector files.  Each file contains a simple grid
> with square cells each 5280x5280.
> Start with 2x2example.  The procedure for all of the examples is identical.
> "v.info 2x2example" to get the limits of the grid.
> Use "g.region" to set the region to match the grid.  In the case of 2x2example
> the limits are n=10560 s=0 w=0 e=10560 nsres=5280 ewres=5280.  In all examples
> the resolution is 5280.  The region so defined should have two rows and two
> columns. 
> Ideally it seems like you should be able to set the region with "g.region
> vect=2x2example."  That may work, but in most examples it does not.  If the
> region is not set exactly to the dimensions of the grid then the next step
> will produce unwanted results.
> "v.to.rast i=2x2example o=2x2example"
> "d.mon start=x0"
> "d.rast -o 2x2example"
> "d.vect 2x2example"
> This should produce an accurate map, with the lines of the vector grid exactly
> outlining the colored cells in the raster map.
> "d.pan"  and click on the image to recenter (e.g., click your pointer in the
> center of the northwest cell).  Repeat this step several times with different
> center locations.  With some centers the map is accurate.  With other centers
> the map is drawn with the raster file offset by half a cell width in both the
> x and y directions.  When there is an offset you can use d.where, d.what.rast
> or d.what.vect to confirm that the vector map is correctly located (southwest
> corner at x=0, y=0) and the raster map is offset.

OK; I understand you now. At first glance, this appears to be a
problem with the display library. I'll look into it, and get back to

Glynn Clements <glynn at gclements.plus.com>

More information about the grass-dev mailing list