Skip to main content
Question

Calculate slope along lines

  • November 23, 2017
  • 9 replies
  • 266 views

ireen
Contributor
Forum|alt.badge.img+5
  • Contributor

Hello,

I want to make a FME model in which the slope along bicycle routes is determined, as well as the direction of the slope (uphill/downhill).

My idea:

- dividing the network in small parts of +/- 50 metres long (LineDivider)

- define the elevation of the start- and endpoint of the lines, as well as the direction

- calculate the slope in between these points + direction

Anyone who can help me with this?

9 replies

jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • November 23, 2017

What about getting a DEM and running it through a RasterSlopeCalculator and a RasterAspectCalculator, then breaking your lines into points (presumably densified first) and using a PointOnRasterValueExtractor.

 

 


ireen
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • November 24, 2017
jdh wrote:

What about getting a DEM and running it through a RasterSlopeCalculator and a RasterAspectCalculator, then breaking your lines into points (presumably densified first) and using a PointOnRasterValueExtractor.

 

 

The issue is that the result should be presented on a cycling map, showing the slope and slope direction on the route segments. When I break the lines into points and get values by the PointOnRasterValueExtractor, I will get punctual information that's possibly not representative for the whole route section.

 

 


takashi
Influencer
  • November 24, 2017

Hi @ireen, if you have a surface model (DEM raster, point cloud, set of 3D points etc.) covering the area, you can drape the lines with the SurfaceDraper (Drape Method: VERTEX). You can then calculate the slope of a line from z-coordinates of start/end nodes and length.


redgeographics
Celebrity
Forum|alt.badge.img+49
takashi wrote:

Hi @ireen, if you have a surface model (DEM raster, point cloud, set of 3D points etc.) covering the area, you can drape the lines with the SurfaceDraper (Drape Method: VERTEX). You can then calculate the slope of a line from z-coordinates of start/end nodes and length.

That's what I did for a cycling map.

 

 

((@Value(_zmax)-@Value(_zmin))/@Value(_length))*100 
Gives you a slope percentage (10m of rise over 100m horizontal is a 10% slope). This was not for a route, so instead of _zmax and _zmin (from a BoundsExtractor) use the first and last z-values, a negative slope means you're going downhill (whee!) 

 

 


ireen
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • December 14, 2017
takashi wrote:

Hi @ireen, if you have a surface model (DEM raster, point cloud, set of 3D points etc.) covering the area, you can drape the lines with the SurfaceDraper (Drape Method: VERTEX). You can then calculate the slope of a line from z-coordinates of start/end nodes and length.

Hi Takashi, I'm still struggling with the surface draper. I get an error saying that Rasters with multiple bands are unsupported, but my reader contains a raster with only 1 band. Nevertheless, I tried the Raster band separator transformer, but this results in the same raster and the same error ("SurfaceDraper(SurfaceModelFactory): Rasters with multiple bands are unsupported."). Any idea what I'm doing wrong?

 


takashi
Influencer
  • December 15, 2017
takashi wrote:

Hi @ireen, if you have a surface model (DEM raster, point cloud, set of 3D points etc.) covering the area, you can drape the lines with the SurfaceDraper (Drape Method: VERTEX). You can then calculate the slope of a line from z-coordinates of start/end nodes and length.

The SurfaceDraper should not raise the error "Rasters with multiple bands are unsupported" if the input raster has just a single band without palette, but it raise another error "Palettes are not supported by this factory" if the single band raster has a palette.

 

Firstly send the raster to an Inspector to check the data structure with Feature Information window in FME Data Inspector.

 

 

Example 1: DEM Raster (Single Band Numeric Raster)

 

 

Example 2: RGB Color Image (Three Bands Image Raster)

 

 


ireen
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • December 18, 2017
takashi wrote:
The SurfaceDraper should not raise the error "Rasters with multiple bands are unsupported" if the input raster has just a single band without palette, but it raise another error "Palettes are not supported by this factory" if the single band raster has a palette.

 

Firstly send the raster to an Inspector to check the data structure with Feature Information window in FME Data Inspector.

 

 

Example 1: DEM Raster (Single Band Numeric Raster)

 

 

Example 2: RGB Color Image (Three Bands Image Raster)

 

 

Hi Takashi,

 

The inspector indeed shows there are 2 bands ... The rasterbandsplitter does not result in 2 rasters, but also 1 (the same). Is there another way to remove the ALPHA8-band?

 

Thanks a lot for your help!

 

 


takashi
Influencer
  • December 18, 2017
takashi wrote:

Hi @ireen, if you have a surface model (DEM raster, point cloud, set of 3D points etc.) covering the area, you can drape the lines with the SurfaceDraper (Drape Method: VERTEX). You can then calculate the slope of a line from z-coordinates of start/end nodes and length.

The RasterBandSeparator should separate a raster with multiple bands into multiple rasters with single band. I think it's a case that should be investigated by Safe support.

 

As a workaround in the interim, the RasterSelector and the RasterBandRemover (or Keeper) should work as well. Try this.

 


ireen
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • December 18, 2017
takashi wrote:
The RasterBandSeparator should separate a raster with multiple bands into multiple rasters with single band. I think it's a case that should be investigated by Safe support.

 

As a workaround in the interim, the RasterSelector and the RasterBandRemover (or Keeper) should work as well. Try this.

 

OK, I'll try it this way.

 

 


Reply


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