Variable shading along vector lines based upon the vertex elevations

geomanniegeomannie Global Mapper UserPosts: 205Trusted User
Hi

I have some OpenStreetMap vector data (roads) and I would like to find some way of applying variable shading along the line based  upon the elevations of the nodal elevations. In other words, I would like to road segments to be shaded by height so that at a glance the height can be determined.

I can't see any way to do this? Is it possible?

Thanks

Best Answers

  • bmg_bobbmg_bob Global Mapper Programmer Posts: 2,114
    Answer ✓
    Hello,

    Here is something that might work. 
    1. Split your lines into a separate feature for each segment. (Crop/Combine/Split Functions -> Split Selected Line(s) into a Line for Each Segment)
    2. Calculate the elevation statistics for each new line feature (Attribute/Style Functions -> Calculate Elevation/Slope Status for each Selected Feature)
    3. Color the new line segment features by attribute (MIN_ELEV_M, MAX_ELEV_M, or AVG_ELEV_M might be a good one.)
    Cheers,
    Bob
  • sphillipssphillips Posts: 184
    Answer ✓
    I looked into it but I couldn't find a solution sorry. The closest I got was to generate points along the line and colour those by elevation. I guess you could split a line into many segments and colour those by elevation. Only other workaround I can think of is to create a buffer around the line and use it to clip a copy of the terrain (or a image export of the terrain).

Answers

  • coelodontacoelodonta Global Mapper User Posts: 29
    Have you tried right clicking the layer in the control centre - options - line styles - apply styling by attributes - select "elevation" - load values- apply by "max and min" when prompted
  • geomanniegeomannie Global Mapper User Posts: 205Trusted User
    Hi

    Thanks for the suggestion but it doesn't really work. There is only one elevation height assigned to each line but each line may be composed of many vertices, each with assigned elevations. Also the vertex elevations do not appear as an atttribute option with the above suggestion.
  • geomanniegeomannie Global Mapper User Posts: 205Trusted User
    Thanks! That should work. I'll post an image when I get the work flow sorted
  • geomanniegeomannie Global Mapper User Posts: 205Trusted User
    edited March 22
    Hi Folks

    I meant to post this sooner, but here is an image showing the slopes of the roads in the Isle of Arran Scotland. I divided the roads into 5m segments, used the GM to calculate the average slope valus from a 1m Lidar grid, and added the slope value to the 5m road segents. Using appropriate shading on the segments, here are gradients changes along some of Arran's roads (in %). Cyclists like to know this stuff!

    PS its not that accuarate as the OSM road vectors locally wander off the real route onto the nearby fields, That causes erroneous values. It could be fixed but I was more interested in the process than the actual result.
    sphillips
Sign In or Register to comment.