I have a mesh ( with points and triangles that define it), and I will need to create a DEM model out of it ( in geotiff format if possible for space consideration, if not, then in ASCII grid format). I need the DEM for watershed and catchment delineation purpose.
Instead of using existing software like ArcGIS, I want to write my code to do it ( in C++ or C#), so that I can later integrate them into my own GIS software. is there anything in GDAL or other open source source code libraries that do this well? Or do I have to write from scratch?
- there are a lot of posts like Seeking tool to generate Mesh from DTM? on how to do it the other way round, ie: from DEM grid points to mesh, but they are not what I want.
- I have a similar question as Getting grid points for DEM purpose that is bounded by surveyor points? on how to get DEM grid points from point clouds, but that is fundamentally different from this one. I don't need the mesh interpolation part for this question, as I already have the mesh.
- I can always create the bounding box for the mesh, loop through each grid points, get the
z, and then construct the grid, but this is crude and can be slow. I'm unsure whether there is a faster way of doing it?