Question

add surface information from raster to vector

  • 4 October 2019
  • 3 replies
  • 23 views

I have got line objects, and a rasterdataset with elevation data.

I try to get both minimum and maximum elevation values as an attribute to the lines, but just can't find out how.

Does anyone know how to do this?

 


3 replies

Badge +22

Buffer the line by a small amount, clip the raster, RasterBandMinMaxExtractor, FeatureJoiner to attach back to the original line.

Use a counter if your lines don't already have a unique ID. It may be more efficient to convert the clipped raster to a point cloud and use the PointCloudStatisticsCalculator to get the Min/Max.

 

 

Userlevel 2
Badge +17

Hi @arjen,

Another method would be to use the SurfaceDraper transformer. Connect the elevation data to the Points/Lines input and the lines to the DrapeFeatures input. In the transformer settings, set Drape Method to MODEL. Connect the DrapedFeatures output to a BoundsExtractor to get the min/max elevations.

The lines will now have more vertices and be 3D. If this is not what you want, you can use a FeatureMerger to merge the min/max elevation info on a copy of the original features, or you can store the original geometry before draping with a GeometryExtractor and restore after getting the bounds with a GeometryReplacer.

Hi @arjen,

Another method would be to use the SurfaceDraper transformer. Connect the elevation data to the Points/Lines input and the lines to the DrapeFeatures input. In the transformer settings, set Drape Method to MODEL. Connect the DrapedFeatures output to a BoundsExtractor to get the min/max elevations.

The lines will now have more vertices and be 3D. If this is not what you want, you can use a FeatureMerger to merge the min/max elevation info on a copy of the original features, or you can store the original geometry before draping with a GeometryExtractor and restore after getting the bounds with a GeometryReplacer.

Thank you, this is exactly what I was looking for.

Reply