[GRASS-user] question about v.to.rast

Hello.

I have some trouble in using v.to.rast.
Could anyone help me, please?

I imported ascii vector data (position data) using v.in.ascii, then
converted it into raster data using v.to.rast as follows;

v.in.ascii input=test.txt output=test x=2 y=1 z=3 columns='x double
precision, y double precision, z double precision' -z
v.to.rast input=test output=test0 use=z

I succeeded to import ascii vector data by v.in.ascii.
However, when I comverted vector to raster, the position of raster
data was not in the right place.
A little moved. If I displayed both vector data and comverted raster
data, the vector position data was not shown within the corresponding
pixel of raster.
How can I solve this problem?

Information about my setting is as follows.

projection: 3 (Latitude-Longitude)
zone: 0
datum: wgs84
ellipsoid: wgs84
north: 29:00:16.07148N
south: 4:59:43.928556N
west: 91:59:43.92852E
east: 110:00:16.0704E
nsres: 0:00:32.142857
ewres: 0:00:32.142857
rows: 2689
cols: 2017
cells: 5423713

A part of imported ascii vector data:
19.3|97.83333333|1.1111
18.16666667|97.93333333|2.1111
19.91666667|99.83333333|3.1111
19.13333333|99.9|4.1111
18.78333333|98.98333333|5.1111
(latitude | longitude | data)

I hope someones's kind help.
I wish you all happy new year!

Natsuko

--
----------------------------------------------------------
YOSHIFUJI Natsuko
Faculty of Agriculture
Kyushu University
E-mail:natsuko@forest.kyushu-u.ac.jp
----------------------------------------------------------

2008/12/31 吉藤奈津子 <natsuko@forest.kyushu-u.ac.jp>:

Hello.

I have some trouble in using v.to.rast.
Could anyone help me, please?

I imported ascii vector data (position data) using v.in.ascii, then
converted it into raster data using v.to.rast as follows;

v.in.ascii input=test.txt output=test x=2 y=1 z=3 columns='x double
precision, y double precision, z double precision' -z
v.to.rast input=test output=test0 use=z

I succeeded to import ascii vector data by v.in.ascii.
However, when I comverted vector to raster, the position of raster
data was not in the right place.
A little moved. If I displayed both vector data and comverted raster
data, the vector position data was not shown within the corresponding
pixel of raster.
How can I solve this problem?

Information about my setting is as follows.

projection: 3 (Latitude-Longitude)
zone: 0
datum: wgs84
ellipsoid: wgs84
north: 29:00:16.07148N
south: 4:59:43.928556N
west: 91:59:43.92852E
east: 110:00:16.0704E
nsres: 0:00:32.142857
ewres: 0:00:32.142857
rows: 2689
cols: 2017
cells: 5423713

A part of imported ascii vector data:
19.3|97.83333333|1.1111
18.16666667|97.93333333|2.1111
19.91666667|99.83333333|3.1111
19.13333333|99.9|4.1111
18.78333333|98.98333333|5.1111
(latitude | longitude | data)

I hope someones's kind help.
I wish you all happy new year!

I think that you need adjust region parameters.

Raster maps are created based on the values of region. You can see the
active region with:

g.region -p

If you wish cells aligned with points, you must define a region
aligned with your the coordinates of your data point.

To see the region covered by the points:

v.info map=name_of_point_map

You must know or determine separation between points too.

Based on the extent of the points map, and the separation between
points, you can calculate the parameters for the desired raster map.

See parameters res, n, s, e, and w in:

http://grass.osgeo.org/grass64/manuals/html64_user/g.region.html

Try with the following region to see the effects of region changes:

g.region -p res=0:45 vect=name_of_point_map
v.to.rast input=test output=test0 use=z

Saludos
José María