Thursday 25 August 2016

gdal - Getting grid points for DEM purpose that is bounded by surveyor points?


I have a list of surveyor points, 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 tools that do this well? Or do I have to write from scratch?



Answer



Actually there is a more direct way of doing it, by using gdal_grid ( in C++ command line), or Gdal.wrapper_GDALGrid ( in GDAL.Net). Here's the code sample:


string vrtFile =@"vrtFile.vrt";
string tiffFile= @"rasterized.tif";
var ds = Gdal.OpenEx(vrtFile, 0, null, null, null);
Gdal.wrapper_GDALGrid(tiffFile, ds, null, null, string.Empty));


A sample of the content in vrt file:




vrtFile.csv
wkbPoint





A sample of content in vrtFile.csv, this is your scattered point list


long,lat,depth
565650,5121960,1048
565680,5121960,1043

No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...