Hi @knigge , if the DEM is given as a raster, I think you can use the PointOnRasterValueExtractor to get the elevation at a point of each polygon.
I can see a few things to try, depending on what you want as output.
1) A polygon whose vertices match the surface: The SurfaceDraper will drape a 2D polygon onto the DEM and give all the vertices a Z value. But I can see why that might not be what you need, because the polygon might cut through the DEM.
2) A draped surface (not polygon): To get a draped surface I would clip the DEM using the polygon outline (Clipper:Inside) and then turn the result into a surface (TinGenerator:TINSurface).
3) A polygon whose "z-value results from the first touch": To get a flat polygon, whose Z value is where it first touches the DEM (i.e. the highest point) is not really much more complex. Clip the DEM using the polygon outline again, but this time send the result to a RasterStatisticsCalculator. This will tell you the maximum height. Pass that value to the polygon (FeatureMerger probably) and then use a 3DForcer set to that value.
I hope this helps.
Hi @knigge , if the DEM is given as a raster, I think you can use the PointOnRasterValueExtractor to get the elevation at a point of each polygon.
Hm, but therefor I need to get Points out of my Polygones, or not?
And then I need hundretes or thouthend of them, because, if a polygone has a length of 1.000 meters, I need for this range at least 1.000 point, better more. So first I need to transfer the 2D Polygone into lines, then the lines into points ...
But I can give it a try.
I can see a few things to try, depending on what you want as output.
1) A polygon whose vertices match the surface: The SurfaceDraper will drape a 2D polygon onto the DEM and give all the vertices a Z value. But I can see why that might not be what you need, because the polygon might cut through the DEM.
2) A draped surface (not polygon): To get a draped surface I would clip the DEM using the polygon outline (Clipper:Inside) and then turn the result into a surface (TinGenerator:TINSurface).
3) A polygon whose "z-value results from the first touch": To get a flat polygon, whose Z value is where it first touches the DEM (i.e. the highest point) is not really much more complex. Clip the DEM using the polygon outline again, but this time send the result to a RasterStatisticsCalculator. This will tell you the maximum height. Pass that value to the polygon (FeatureMerger probably) and then use a 3DForcer set to that value.
I hope this helps.
Thank you for your help!
I tried all solutions and I think I get the best results with the Draper -> CoordinateExtractor -> ListRangeExtractor (the RasterStatisticsCalculator didn't work, cause of "Failed to obtain raster from feature. Only features with raster geometry are expected").
1) At which point could a polygone cut the DEM? If I get it right, the Draper adds at each point, where the polygone hits a line from the DEM, a new vertix + z-value and each vertex from the polygone got a z-value. So, in my head, the polygone will sit exactly on the DEM (maybe waved).
2) Looks like the Clipper -> TINGenerator comes to the same results like the SurfaceDraper but with 2 transformer instead of 1. And after the Clipper my polygones are cut into pieces and in my experience that can cause trouble (even after dissolving them). Additionally the Draper is much faster then the Clipper.
Okay, with the SurfaceDraper I get good solutions.
But there are round about 1% of strange results, which I can't explain. Somebody got an idea, what happend there? See the Screenshot.
My desired solution would be a blue polygon, which sits just on the turquoise one.
Hello @knigge , thanks for the screenshot! Sorry - it isn't too clear what format your DEM is? Do you know if the DEM is a raster with a grid of points or a set of points at random locations? If your DEM is a raster with a grid of points, these results do seem rather strange. I think the solution is to have smaller triangles (more points) or use breaklines (if available). Alternatively, you could try and experiment with different parameters (reduced tolerance, different interpolation, etc.). Hope this helps - Kailin.
Hello @knigge , thanks for the screenshot! Sorry - it isn't too clear what format your DEM is? Do you know if the DEM is a raster with a grid of points or a set of points at random locations? If your DEM is a raster with a grid of points, these results do seem rather strange. I think the solution is to have smaller triangles (more points) or use breaklines (if available). Alternatively, you could try and experiment with different parameters (reduced tolerance, different interpolation, etc.). Hope this helps - Kailin.
Hello @kailinatsafe , thank you for your answer.
Primary the DEM was a raster with a grid of points. Due to the amount of data it is necessary to reduce the triangles where the vertical height allow it. In result we get a DEM which looks like the vertex are set as random. The DEM is fix and I can't make changes on it.
I tried already different parameters, all with the same result. Even the Clipper do the same in this case.