Re: [GRASS-user] Elevation profile from intersecting shapefiles‏

georgew gws293 at hotmail.com
Wed Dec 3 18:36:53 EST 2008


Thanks Micha, here we go:


Micha Silver wrote:
> 
> How many shapefiles did you have in the GRASSDATA directory? ....
> 

I had the two shapefiles, Contour and Track, but I got your message loud and
clear about creating separate vectors, which I did and displayed as follows:

v.in.ogr -o dsn=/home/george/GRASSDATA/Contour.shp output=contours
min_area=0.0001 type=line snap=-1 --overwrite 

v.in.ogr -o dsn=/home/george/GRASSDATA/Track_cl.shp output=tracks
min_area=0.0001 type=line snap=-1 --overwrite 

d.vect map=contours at test02 color=0:0:0 lcolor=0:0:0 fcolor=170:170:170
display=shape type=point,line,boundary,area icon=basic/circle size=5 layer=1
lsize=8 xref=left yref=center llayer=1

d.vect map=tracks at test02 color=255:0:0 lcolor=0:0:0 fcolor=170:170:170
display=shape type=point,line,boundary,area icon=basic/circle size=5 width=3
layer=1 lsize=8 xref=left yref=center llayer=1
No problems so far, all displayed correctly.


Micha Silver wrote:
> 
> At this point I'd check to make sure the elevation data came thru: 
> 
v.info -c contours at test02
Displaying column types/names for database connection of layer 1:
INTEGER|cat
DOUBLE PRECISION|ID
CHARACTER|CRT_DATE
CHARACTER|MOD_DATE
DOUBLE PRECISION|ELEVATION
CHARACTER|DESIGNATED
CHARACTER|NAT_FORM
CHARACTER|DEFINITION

v.info -c tracks at test02
Displaying column types/names for database connection of layer 1:
INTEGER|cat
DOUBLE PRECISION|ID
CHARACTER|NAME
CHARACTER|CRT_DATE
CHARACTER|MOD_DATE
CHARACTER|TRACK_USE
CHARACTER|TRACK_TYPE
CHARACTER|TRK_STATUS
DOUBLE PRECISION|area
DOUBLE PRECISION|len

v.db.select map=contours at test02 layer=1 column=ELEVATION fs=| 
ELEVATION
1180
1220
1200
etc...
etc...

So far all is as it should be (I think..)

Convert vector to raster: (no problems reported)
v.to.rast input=contours at test02 output=contours_rast use=attr type=line
layer=1 column=ELEVATION value=1 rows=100000 --overwrite 
 (... Converted points/lines: 630 of 630)
----
Display raster map (PROBLEM:only displays large, brightly coloured
rectangles, no contours
d.rast map=contour_rast at test02 -o
----

How did you set up the Location/Mapset ? You might have a problem with
the resolution. 
What do you get from: 
r.info testrastmap 
g.region -p 
/quote>

I set the Location in GRASS's opening welcome screen, using the Contour.shp
file to provide the boundaries. Here is the result:

r.info contours_rast
+----------------------------------------------------------------------------+
 | Layer:    contours_rast                  Date: Thu Dec  4 08:50:19 2008   
|
 | Mapset:   test02                         Login of Creator: george         
|
 | Location: test02                                                          
|
 | DataBase: /home/george/GRASSDATA                                          
|
 | Title:    Labels ( contours_rast )                                        
|
 | Timestamp: none                                                           
|

|----------------------------------------------------------------------------|
 |                                                                           
|
 |   Type of Map:  raster               Number of Categories: 0              
|
 |   Data Type:    DCELL                                                     
|
 |   Rows:         20                                                        
|
 |   Columns:      20                                                        
|
 |   Total Cells:  400                                                       
|
 |        Projection: x,y                                                    
|
 |            N:  6020724.5    S: 6013982.586   Res: 337.0957                
|
 |            E: 2481099.136    W: 2467034.878   Res: 703.2129               
|
 |   Range of data:    min = 520.000000  max = 1840.000000                   
|
 |                                                                           
|
 |   Data Source:                                                            
|
 |    Vector Map: contours at test02 in mapset test02                           
|
 |    Original scale from vector map: 1:1                                    
|
 |                                                                           
|
 |   Data Description:                                                       
|
 |    generated by v.to.rast                                                 
|
 |                                                                           
|
 |   Comments:                                                               
|
 |    v.to.rast input="contours at test02" output="contours_rast" use="attr" \  
|
 |    type="line" layer=1 column="ELEVATION" value=1 rows=100000             
|
 |                                                                           
|

+----------------------------------------------------------------------------+
GRASS 6.3.0 (test02):~ > g.region -p
projection: 0 (x,y)
zone:       0
north:      6020724.5
south:      6013982.586
west:       2467034.878
east:       2481099.136
nsres:      337.0957
ewres:      703.2129
rows:       20
cols:       20
cells:      400

I hope all this helps. Your help so far has been invaluable, thanks a lot.

PS I tried to play around with resolution in the Region dialog but the
display never changed from the same chunky coloured squares.
-- 
View this message in context: http://www.nabble.com/Elevation-profile-from-intersecting-shapefiles%E2%80%8F-tp20744104p20824147.html
Sent from the Grass - Users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20081203/e110b618/attachment-0001.html


More information about the grass-user mailing list