Skip to main content
Solved

DEM to Slope to shape.


Forum|alt.badge.img

I want to take a DEM with a 1 foot resolution (horizontal) calculate slopes and output two polygons 1 with the slopes drom 12 to 17 degrees and the other with slopes above 17 degrees. the rest can be discarded. Is there a sample workspace I can study to perform this?

Thanks

Best answer by hollyatsafe

Hi @brandj57,

This article might help you get started: https://knowledge.safe.com/articles/28517/raster-slope-calculations.html with calculating the slopes.

Once you have the slope you can use a RasterCellCoercer to extract these band values as an attribute in vector format and then used a TestFilter using the 'in range' and 'greater than' operators to sort the features you want to keep. In its current state each raster cell will be an individual polygon so you could then use a dissolver to group these into a single polygon.

View original
Did this help you find an answer to your question?

7 replies

Forum|alt.badge.img+2
  • Best Answer
  • August 14, 2018

Hi @brandj57,

This article might help you get started: https://knowledge.safe.com/articles/28517/raster-slope-calculations.html with calculating the slopes.

Once you have the slope you can use a RasterCellCoercer to extract these band values as an attribute in vector format and then used a TestFilter using the 'in range' and 'greater than' operators to sort the features you want to keep. In its current state each raster cell will be an individual polygon so you could then use a dissolver to group these into a single polygon.


Forum|alt.badge.img+2
hollyatsafe wrote:

Hi @brandj57,

This article might help you get started: https://knowledge.safe.com/articles/28517/raster-slope-calculations.html with calculating the slopes.

Once you have the slope you can use a RasterCellCoercer to extract these band values as an attribute in vector format and then used a TestFilter using the 'in range' and 'greater than' operators to sort the features you want to keep. In its current state each raster cell will be an individual polygon so you could then use a dissolver to group these into a single polygon.

@brandj57, Actually you could use the RasterToPolygonCoercer instead of the RasterCellCoercer and this would remove the need for a dissolver after the TestFilter!

 

 


Forum|alt.badge.img
  • Author
  • August 16, 2018
hollyatsafe wrote:

Hi @brandj57,

This article might help you get started: https://knowledge.safe.com/articles/28517/raster-slope-calculations.html with calculating the slopes.

Once you have the slope you can use a RasterCellCoercer to extract these band values as an attribute in vector format and then used a TestFilter using the 'in range' and 'greater than' operators to sort the features you want to keep. In its current state each raster cell will be an individual polygon so you could then use a dissolver to group these into a single polygon.

@hollyatsafe

Thanks for the assist. It seems to have worked. The routine ran for many hours. It seems that with 1/2 a terabyte of disk space and 32 gig of ram the program still had problems with resources!


Forum|alt.badge.img+2
brandj57 wrote:

@hollyatsafe

Thanks for the assist. It seems to have worked. The routine ran for many hours. It seems that with 1/2 a terabyte of disk space and 32 gig of ram the program still had problems with resources!

Hi @brandj57,

 

I'm glad that did the trick for you! I believe the RasterCellCoercer is known to be quite a memory intensive transformer however since you need to convert to vector I think it is the best option in this case. I do have two suggestions here though - if you did not already then I would try the RasterToPolygonCoercer, since this does not create a polygon for every cell but rather groups neighbouring cells if they have the same value. Secondly as noted in the Usage Notes in the transformer documentation you could try adding a RasterCheckpointer before the RTPC.

 


Forum|alt.badge.img
  • Author
  • August 16, 2018
hollyatsafe wrote:

Hi @brandj57,

This article might help you get started: https://knowledge.safe.com/articles/28517/raster-slope-calculations.html with calculating the slopes.

Once you have the slope you can use a RasterCellCoercer to extract these band values as an attribute in vector format and then used a TestFilter using the 'in range' and 'greater than' operators to sort the features you want to keep. In its current state each raster cell will be an individual polygon so you could then use a dissolver to group these into a single polygon.

@hollyatsafe

I did as you suggested and the checkpointer did help but there seems to be massive memory issues after the checkpointer. I suppose I could resample the data too a much coarser resolution but that results in a fair bit less accuracy in the polygons.

I'm thinking a TestFilter before the RasterToPolygonCoercer but for the life of me I can't seem to make it work I'm trying to filter any Band 0 over >= 15 but I must not have the syntax correct because nothing is filtered.


Forum|alt.badge.img+2
brandj57 wrote:

@hollyatsafe

I did as you suggested and the checkpointer did help but there seems to be massive memory issues after the checkpointer. I suppose I could resample the data too a much coarser resolution but that results in a fair bit less accuracy in the polygons.

I'm thinking a TestFilter before the RasterToPolygonCoercer but for the life of me I can't seem to make it work I'm trying to filter any Band 0 over >= 15 but I must not have the syntax correct because nothing is filtered.

Hi @brandj57,

 

hmm I am not sure it is possible to to test band values from a raster - this is where the RasterCellCoercer comes in handy as it exposes these values as an attribute to test. Another option however, following your train of thought might be to use the RasterCellValueReplacer before the RTPC and set all the values <15 to 0, this should reduce the number of polygons being created.

 


Forum|alt.badge.img
  • Author
  • August 17, 2018
hollyatsafe wrote:

Hi @brandj57,

This article might help you get started: https://knowledge.safe.com/articles/28517/raster-slope-calculations.html with calculating the slopes.

Once you have the slope you can use a RasterCellCoercer to extract these band values as an attribute in vector format and then used a TestFilter using the 'in range' and 'greater than' operators to sort the features you want to keep. In its current state each raster cell will be an individual polygon so you could then use a dissolver to group these into a single polygon.

@hollyatsafe

Thanks for the suggestion. I tried replace values to zero for anything below 15 and the 1 foot "only" took 14 hours. (Previously 26 hours)

I used a resampled to 5 foot DEM with the same parameters and the result was available in 3 1/2 minutes with not much real difference in the resulting shapes. Thanks for the assists!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings