You want the points to represent cell centers so you need to expand your region 1/2 pixel in all four directions. Also look at using r.in.xyz, it works directly on this type of data.<div><br></div><div>Jamie<br><br><div class="gmail_quote">
On Thu, May 13, 2010 at 7:26 AM, Hanlie Pretorius <span dir="ltr"><<a href="mailto:hanlie.pretorius@gmail.com">hanlie.pretorius@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<br>
<br>
I've obtained DEMs in text files with columns X, Y and Z at 25m<br>
spacing. The first three entries in the text file are:<br>
<br>
-----<br>
X,Y,Z<br>
99550,2.9883e+06,1473.47<br>
99550,2.98828e+06,1473.57<br>
99550,2.98825e+06,1473.63<br>
-----<br>
<br>
To me it seems the easiest way to import these is the following:<br>
<br>
1. v.in.ascii<br>
<br>
2. Set the region to the extents of new vector file and the resolution to 25m.<br>
<br>
3. v.to.rast.<br>
<br>
<br>
This 'works' but I get horizontal strips of no data in my raster DEM<br>
at 25m spacings.<br>
<br>
Also, when I look at the raster and the vector layer together, the<br>
vector points are not always on the edges of the raster cells.<br>
<br>
Can someone perhaps help me to fix this?<br>
<br>
g.region:<br>
<br>
projection: 99 (Transverse Mercator)<br>
zone: 0<br>
datum: ** unknown (default: WGS84) **<br>
ellipsoid: wgs84<br>
north: 2988300<br>
south: 2959850<br>
west: 74300<br>
east: 99550<br>
nsres: 25<br>
ewres: 25<br>
rows: 1138<br>
cols: 1010<br>
cells: 1149380<br>
<br>
<a href="http://v.info" target="_blank">v.info</a>:<br>
+----------------------------------------------------------------------------+<br>
| Layer: dem_2628cc_25m@C83<br>
| Mapset: C83<br>
| Location: sa_tm_19deg_E<br>
| Database: C:\Hanlie\grassdata<br>
| Title:<br>
| Map scale: 1:1<br>
| Map format: native<br>
| Name of creator: Administrator<br>
| Organization:<br>
| Source date: Thu May 13 16:06:07 2010<br>
|----------------------------------------------------------------------------|<br>
| Type of Map: vector (level: 2)<br>
|<br>
| Number of points: 1151529 Number of areas: 0<br>
| Number of lines: 0 Number of islands: 0<br>
| Number of boundaries: 0 Number of faces: 0<br>
| Number of centroids: 0 Number of kernels: 0<br>
|<br>
| Map is 3D: Yes<br>
| Number of dblinks: 0<br>
|<br>
| Projection: Transverse Mercator<br>
| N: 2988300 S: 2959850<br>
| E: 99550 W: 74300<br>
| B: 1429.79 T: 1740.2<br>
|<br>
| Digitization threshold: 0<br>
| Comments:<br>
|<br>
+----------------------------------------------------------------------------+<br>
<br>
<a href="http://r.info" target="_blank">r.info</a>:<br>
<br>
+----------------------------------------------------------------------------+<br>
| Layer: dem_2628cc_25m@C83 Date: Thu May 13 16:15:50 2010<br>
| Mapset: C83 Login of Creator: Administrator<br>
| Location: sa_tm_19deg_E<br>
| DataBase: C:\Hanlie\grassdata<br>
| Title: Categories ( dem_2628cc_25m )<br>
| Timestamp: none<br>
|----------------------------------------------------------------------------|<br>
| |<br>
| Type of Map: raster Number of Categories: 0<br>
| Data Type: DCELL<br>
| Rows: 1138<br>
| Columns: 1010<br>
| Total Cells: 1149380<br>
| Projection: Transverse Mercator<br>
| N: 2988300 S: 2959850 Res: 25<br>
| E: 99550 W: 74300 Res: 25<br>
| Range of data: min = 1429.850000 max = 1739.410000<br>
|<br>
| Data Source:<br>
| Vector Map: dem_2628cc_25m@C83 in mapset C83<br>
| Original scale from vector map: 1:1<br>
|<br>
| Data Description:<br>
| generated by v.to.rast<br>
|<br>
| Comments:<br>
| v.to.rast input="dem_2628cc_25m@C83" output="dem_2628cc_25m" use="z"\<br>
| type="point,line,area" layer=1 value=1 rows=4096<br>
|<br>
+----------------------------------------------------------------------------+<br>
<br>
Thanks<br>
Hanlie<br>
_______________________________________________<br>
grass-user mailing list<br>
<a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/grass-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-user</a><br>
</blockquote></div><br></div>