how to merge shapefile to DEM and run viewshed

3793
11
Jump to solution
06-12-2012 10:34 PM
TomasTomsky
New Contributor
Hi!

I have a problem using viewshed. Im doing analysis of where tower is visible and where not. I have done viewshed analysis of my data (DEM, towerpoints), I have calculated OFFSETA, OFFSETB, RADIUS...) I have also a shapefile, that consists of forest area. My problem is, how I can insert forest elevation to my viewshed analysis? In this analysis average height of forest should be 15m, so I have to add that information to viewshed, because that take effect in visibility analysis.

So, how i can merge (or do i have to merge) DEM and forest shapefile into one and run that new file in viewshed?
Is there some other way, that I can add that information (forest area 15m height) in my analysis?
Tags (1)
0 Kudos
1 Solution

Accepted Solutions
EricRice
Esri Regular Contributor
Tomas,

There a number of forums that discuss this, but I can outline it for you.  First, I will assume your forest polygons have an attribute field for height.  Given this, when you convert the polygons to raster you need to specify the height field to use as the value field during the conversion.  You need to set the extent of output to be equal to your DEM, and at the same resolution.  This will result in a raster that covers the entire DEM area, and is made up of data (where you had polygons) and nodata pixels (no polygon data).  Next you want to add the tree height raster to the DEM, and where you have no tree height data you want to return the original DEM value.  You do this will map algebra.  This syntax is old (pre 10) because I copied it from another forum where I posted in but the concept is here for you.

[newsurface] = CON(ISNULL([treeheight]),[dem],[dem] + [treeheight])

Once you have the surface that incorporates the tree's you will have to rerun Viewshed.

Regards,
Eric

View solution in original post

0 Kudos
11 Replies
TomasTomsky
New Contributor
Hi!

I have a problem using viewshed. Im doing analysis of where tower is visible and where not. I have done viewshed analysis of my data (DEM, towerpoints), I have calculated OFFSETA, OFFSETB, RADIUS...) I have also a shapefile, that consists of forest area. My problem is, how I can insert forest elevation to my viewshed analysis? In this analysis average height of forest should be 15m, so I have to add that information to viewshed, because that take effect in visibility analysis.

So, how i can merge (or do i have to merge) DEM and forest shapefile into one and run that new file in viewshed?
Is there some other way, that I can add that information (forest area 15m height) in my analysis?


I was able to get also forest area data in grid format. But still i can´t figure it out, how it is possible to change height of these forest areas and then make a viewshed analysis. I think that first thing to do is "mosaic" these two raster-files into one..
0 Kudos
EricRice
Esri Regular Contributor
Tomas,

There a number of forums that discuss this, but I can outline it for you.  First, I will assume your forest polygons have an attribute field for height.  Given this, when you convert the polygons to raster you need to specify the height field to use as the value field during the conversion.  You need to set the extent of output to be equal to your DEM, and at the same resolution.  This will result in a raster that covers the entire DEM area, and is made up of data (where you had polygons) and nodata pixels (no polygon data).  Next you want to add the tree height raster to the DEM, and where you have no tree height data you want to return the original DEM value.  You do this will map algebra.  This syntax is old (pre 10) because I copied it from another forum where I posted in but the concept is here for you.

[newsurface] = CON(ISNULL([treeheight]),[dem],[dem] + [treeheight])

Once you have the surface that incorporates the tree's you will have to rerun Viewshed.

Regards,
Eric
0 Kudos
TomasTomsky
New Contributor
Tomas,

There a number of forums that discuss this, but I can outline it for you.  First, I will assume your forest polygons have an attribute field for height.  Given this, when you convert the polygons to raster you need to specify the height field to use as the value field during the conversion.  You need to set the extent of output to be equal to your DEM, and at the same resolution.  This will result in a raster that covers the entire DEM area, and is made up of data (where you had polygons) and nodata pixels (no polygon data).  Next you want to add the tree height raster to the DEM, and where you have no tree height data you want to return the original DEM value.  You do this will map algebra.  This syntax is old (pre 10) because I copied it from another forum where I posted in but the concept is here for you.

[newsurface] = CON(ISNULL([treeheight]),[dem],[dem] + [treeheight])

Once you have the surface that incorporates the tree's you will have to rerun Viewshed.

Regards,
Eric


Thanks for your help Eric, I appreciate your help!
I have still few guestions, that I need to solve to move forvard in my analysis.

Here is what I have done so far:

1) I made z rows to my forest polygon by "Interpolate shape"-tool. (In this tool I left Z-factor to 1, which is same as it is in original DEM). Im not sure if that was the right tool for making my polygon an attribute field for height. If not, how I can add that height information to my polygon?
As you Eric suggested, next I tried to convert polygon to raster using height as the value field. I tried to convert this file using "Polygon to raster". Im a little confused, which is the right field for height. When I used "interpolate shape"-tool, it didn´t add any new rows, but it made polygon to 3d. So, I set "Shape_area" as value field.

2) No I have two raster, my original DEM (heightraster) and new forest raster. Next I have to convert these rasters to one, but before that I have to add this average height to forest raster (15m).
I know that Im little hard to follow,and Eric has given information that should help. Still Im thinking how I can add these 15 m to my forest raster. I think if I can solve that 15m-question, then It would be easy to merge these two rasters and finally viewshed.
If I understood right, I have to use "reclassify"-tool to get height values for trees. I havent used this tool before, so Im not sure how I can reclassify these values, that result is 15m higher.
Tomas
0 Kudos
TomasTomsky
New Contributor
text


OK, here is what I did. I managed to get forest rasterdata and elevation raster data. I used Raster calculator, and made a a Con syntax there, as Eric mentioned before.
[newsurface] = CON(ISNULL([treeheight]),[dem],[dem] + [treeheight]).
After that I added this new raster to original dem, and finally got raster, that I can use in viewshed.
Sorry all the mess in the middle, and thanks again to Eric
-Tomas
0 Kudos
TomasTomsky
New Contributor
You do this will map algebra.  This syntax is old (pre 10) because I copied it from another forum where I posted in but the concept is here for you.

[newsurface] = CON(ISNULL([treeheight]),[dem],[dem] + [treeheight])

Once you have the surface that incorporates the tree's you will have to rerun Viewshed.

Regards,
Eric


One more guestion. Did you mean in that syntax that "treeheight" is height of trees, in my case 15m, and "dem" is my original heightraster. So in my case it would go like this?
Con(Isnull(15),(dem),(dem)+15) OR
Con(isnull(treeraster),(dem),(dem)+treeraster)?
0 Kudos
EricRice
Esri Regular Contributor
Hi Tomas,

Con(isnull(treeraster),(dem),(dem)+treeraster) is the one to use.  The treeraster in this example is created from polygons that have an attribute of height (such as 15 m) and have been converted to raster using that attribute for the value field.  This would result in a raster that has pixels with a value of 15 underneath the polygon, but NoData where you have no polygons. 

Eric
0 Kudos
TomasTomsky
New Contributor
The treeraster in this example is created from polygons that have an attribute of height (such as 15 m) and have been converted to raster using that attribute for the value field.  This would result in a raster that has pixels with a value of 15 underneath the polygon, but NoData where you have no polygons. 


I was able to got treeheight also in rastermode. I edited it so that treeheight is 15 m. I did that with "reclassify"-tool. I must confirm that I did it right. I changed values in "VALUE"-field so that new values are 15 and "nodata" is 0. I have 3 different treetypes in my data, but the height is 15m in all types. After that I got raster that has only trees and height is probably 15 m (?) Does it matter that this new raster has backroundcolour? So my next step is to use raster calculator as Eric mentioned . Do I have to merge this new file to my original DEM? Another guestion is, how and where I can check that I have now 15 m higher raster? In my original dem it shows max high: 159.33 and in my new raster it shows max high: 159,247. Where is that 15m?
0 Kudos
TomasTomsky
New Contributor
text...

I managed to got new values for my raster when i used treepolygon and created height values and converted it to raster instead of treeraster that i got. Now when I used this data, max high is 15 m longer than original dem. My problem was that i didn´t use treepolygon in the first place. I used treeraster that i got and that made things going wrong. Thank you again Eric for your help!
0 Kudos
TomasTomsky
New Contributor
This is probalbly wrong thread, but because I have sent many posts here, I keep on going. How you can remove tree cover from your viewshed? I have run viewshed analysis, but now I have to remove visibility areas that are within treepolygon (shapefile). Can you do that after viewshed, or do you have to do something before doing viewshed that there is not visibility "in the middle of the forrest"?
0 Kudos