Solved

DEM to Slope to shape.

  • 14 August 2018
  • 7 replies
  • 39 views

Badge

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

icon

Best answer by hollyatsafe 14 August 2018, 21:59

View original

7 replies

Badge +2

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.

Badge +2

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!

 

 

Badge

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!

Badge +2

@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.

 

Badge

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.

Badge +2

@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.

 

Badge

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!

Reply