Hi,
The way would be different according to geometry type of the DEM.
For example, if the DEM was given as a raster having 1 band (cell value = elevation), one possible way is:
1) Transform the polygons into individual vertex points by the Chopper, and extract Z-coordinate for each vertex by the CoordinateExtractor.
2) Transform the DEM raster into individual cell polygons by the RasterCellCoercer.
Output Cell Geometry: Polygons
Extract Band Values As: Z Values
3) Add a SpatialFilter; send 1) vertex points to the Filter port, send 2) cell polygons to the Candidate port.
4) Connect a 3DForcer to the Passed port to change Z of each cell polygon to the Z attribute value of related vertex point.
5) Transform all the cell polygons (output from both the 3DForcer and Failed port of the SpatialFilter) into their center points by the CenterPointReplacer.
6) Send the points to the NumericRasterizer to re-create a raster with the original raster properties.
The original raster properties can be extracted with the RasterPropertiesExtractor, if necessary.
Takashi
Hi Takashi,
Thanks for the rpely. I implemented the process. But if the polygon only has vertices on the corners, do the functions after spatial filter affect the z values in the area within the polygon?
I can only imagine it only affects the z values around the corners only.
I took the output made it into a contour shapefile and overlayed the original polygon, but the lines of the contour don't appear to conform to the plane's grandient.
Thanks.
In the method I mentioned, only vertices of the polygons affect the DEM. The behavior matches with your explanation -
"a vertex on the plane has z value 9. Same geographical location on the DEM, it's approximately 11. I need the 11 value to be 9".
If (interpolated) elevation of any location inside the plane polygons has to affect the DEM, other approach is necessary. For example:
1) Transform the DEM raster into individual cell points by the RasterCellCoercer.
Output Cell Geometry: Points
Extract Band Values As: Z Values
2) Add a SpatialFilter; send the plane polygons to the Filter port, send the cell points to the Candidate port.
3) Add a SurfaceDraper; send the plane polygons to the Points/Lines port, send the cell points output from the Passed port of the SpatialFilter to the DrapeFeatures port.
Existing Elevation: Replace Z
4) Send all the cell points (output from both the SurfaceDraper and Failed port of the SpatialFilter) to the NumericRasterizer to re-create a raster with the original raster properties.
Thanks again. I believe your process works. But I had an issue with the SpatialFilter, it could not determine any points within the polygon range. I checked the coordinate system, tried variations to the test requirements i.e intersect, overlap etc.
I've ended up using clipper to help seperate the required points to then SurfaceDrape.
Any thoughts why spatial filter might not detect the points?
Sounds strange. Since the Clipper worked a treat, the SpatialFilter should also work well.
Check these parameter settings.
Group By:
<not set>
Filter Type: Multiple Filters
Pass Criteria: Pass Against One Filter
Anyway the Clipper is good choice. In many cases, the Clipper is more efficient than the SpatialFilter when filtering points by polygons.