[GRASS-user] dems from coordinate lists

Micha Silver micha at arava.co.il
Thu May 13 13:47:03 EDT 2010


MS wrote:

> If I follow correctly, instead of v.to.rast, you need to interpolate a 
> raster DEM from the points.   v.surf.rst produces nice results, but 
> there are other interpolation modules as well in the raster category.
>
That's the method I use also.
I start with:
v.in.ascii -z in=<ascii_file> z=3 out=vect_pts
This creates a 3D vector using the z column as the height values.
Now set the desired region:
g.region vect=vect_pts res=xxx
Choose the raster resolution that suits your needs. If the points in the 
ascii file are at 25 m spacing, then you probably could interpolate at 
10m-20m resolution (or better) with no problems.
Then:
v.surf.rst in=vect_pts layer=0 elev=dem ...
The layer=0 parameter indicates that you're using the 3D vector's z 
value for elevation.
-- 
Micha
> Best regards,
>
> Mark
>
> On May 13, 2010, at 10:26 AM, Hanlie Pretorius 
> <hanlie.pretorius at gmail.com> wrote:
>
>> Hi,
>>
>> I've obtained DEMs in text files with columns X, Y and Z at 25m
>> spacing. The first three entries in the text file are:
>>
>> -----
>> X,Y,Z
>> 99550,2.9883e+06,1473.47
>> 99550,2.98828e+06,1473.57
>> 99550,2.98825e+06,1473.63
>> -----
>>
>> To me it seems the easiest way to import these is the following:
>>
>> 1. v.in.ascii
>>
>> 2. Set the region to the extents of new vector file and the 
>> resolution to 25m.
>>
>> 3. v.to.rast.
>>
>>
>> This 'works' but I get horizontal strips of no data in my raster DEM
>> at 25m spacings.
>>
>> Also, when I look at the raster and the vector layer together, the
>> vector points are not always on the edges of the raster cells.
>>
>> Can someone perhaps help me to fix this?
>>
>> g.region:
>>
>> projection: 99 (Transverse Mercator)
>> zone:       0
>> datum:      ** unknown (default: WGS84) **
>> ellipsoid:  wgs84
>> north:      2988300
>> south:      2959850
>> west:       74300
>> east:       99550
>> nsres:      25
>> ewres:      25
>> rows:       1138
>> cols:       1010
>> cells:      1149380
>>
>> v.info:
>> +----------------------------------------------------------------------------+ 
>>
>> | Layer:           dem_2628cc_25m at C83
>> | Mapset:          C83
>> | Location:        sa_tm_19deg_E
>> | Database:        C:\Hanlie\grassdata
>> | Title:
>> | Map scale:       1:1
>> | Map format:      native
>> | Name of creator: Administrator
>> | Organization:
>> | Source date:     Thu May 13 16:06:07 2010
>> |----------------------------------------------------------------------------| 
>>
>> |   Type of Map:  vector (level: 2)
>> |
>> |   Number of points:       1151529         Number of areas:      0
>> |   Number of lines:        0               Number of islands:    0
>> |   Number of boundaries:   0               Number of faces:      0
>> |   Number of centroids:    0               Number of kernels:    0
>> |
>> |   Map is 3D:              Yes
>> |   Number of dblinks:      0
>> |
>> |         Projection: Transverse Mercator
>> |               N:           2988300    S:           2959850
>> |               E:             99550    W:             74300
>> |               B:           1429.79    T:            1740.2
>> |
>> |   Digitization threshold: 0
>> |   Comments:
>> |
>> +----------------------------------------------------------------------------+ 
>>
>>
>> r.info:
>>
>> +----------------------------------------------------------------------------+ 
>>
>> | Layer:    dem_2628cc_25m at C83             Date: Thu May 13 16:15:50 
>> 2010
>> | Mapset:   C83                            Login of Creator: 
>> Administrator
>> | Location: sa_tm_19deg_E
>> | DataBase: C:\Hanlie\grassdata
>> | Title:    Categories ( dem_2628cc_25m )
>> | Timestamp: none
>> |----------------------------------------------------------------------------| 
>>
>> |        
>>                                                                     |
>> |   Type of Map:  raster               Number of Categories: 0
>> |   Data Type:    DCELL
>> |   Rows:         1138
>> |   Columns:      1010
>> |   Total Cells:  1149380
>> |        Projection: Transverse Mercator
>> |            N:    2988300    S:    2959850   Res:    25
>> |            E:      99550    W:      74300   Res:    25
>> |   Range of data:    min = 1429.850000  max = 1739.410000
>> |
>> |   Data Source:
>> |    Vector Map: dem_2628cc_25m at C83 in mapset C83
>> |    Original scale from vector map: 1:1
>> |
>> |   Data Description:
>> |    generated by v.to.rast
>> |
>> |   Comments:
>> |    v.to.rast input="dem_2628cc_25m at C83" output="dem_2628cc_25m" 
>> use="z"\
>> |     type="point,line,area" layer=1 value=1 rows=4096
>> |
>> +----------------------------------------------------------------------------+ 
>>
>>
>> Thanks
>> Hanlie
>> _______________________________________________
>> grass-user mailing list
>> grass-user at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/grass-user
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>
> This mail was received via Mail-SeCure System.
>
>


-- 
Micha Silver
Arava Development Co. +972-52-3665918
http://www.surfaces.co.il
 



More information about the grass-user mailing list