title: What are the corresponding fields to set in libtiff or libgeotiff, given a minimal ESRI ASCII file?
body: <p>I have an ESRI ASCII file of the form:</p>
  
  <pre><code>ncols         5 
  nrows         4 
  xllcorner     0 
  yllcorner     0 
  cellsize      10 
  NODATA_value  -9999 
  25.4 26.1 27 28.6 27.7
  25 26 26.4 27.9 27.4
  25.1 25.8 26.8 28.6 27.6
  27.5 28 27.7 30.6 28.3
  </code></pre>
  
  <p>And I need to use libtiff.net ( or its C++ equivalent, libtiff, or libgeotiff, or GDAL, or <em>any other C# or C++ libraries</em>) to convert it to a geotiff file.</p>
  
  <p>But I simply don't know what are the fields to set, there are a lot of fields such as <code>TIFFTAG_IMAGEWIDTH</code>, <code>TIFFTAG_SAMPLESPERPIXEL</code> or <code>TIFFTAG_BITSPERSAMPLE</code> which I don't know whether they are relevant or not. </p>
  
  <p>Given an ESRI ASCII file as per above, how to use the libtiff.net or libtiff library to create a geotiff file?</p>
  
  <h2>Why am I doing this?</h2>
  
  <p>In my application, I have a mesh, and I would have to convert the mesh to a raster file. I want to create such a geotiff raster file directly from the mesh sampling, without creating an intermediate ASCII file first because the intermediate file size is very big compared to the final geotiff output file.</p>
  
  <p>The only approach I can think of is to directly manipulate the geotiff file using  libtiff.net while I am obtaining the grid points on the mesh. </p>
  
  <p>How to do this, or is there a better approach?</p>