Workflow tif File to Mesh Files


Provided by Richard Middleton rsm@lanl.gov Nov 2016

Files created using ARC Tools:

    2013DEM_AreaA.png         image of data from viewer to verify results

    2013DEM_AreaA_about.txt   description from viewer to define extents and data information

    2013DEM_AreaA.txt         "ArcToolbox" -> "Conversion Tools" -> "From Raster" -> "Raster to point" 
                              ascii list of x,y,z points
                              this is preferred since x,y,z points are explicit

    2013DEM_AreaA.asc         "ArcToolbox" -> "Conversion Tools" -> "From Raster" -> "Raster to ascii" 
                              ascii elevations by row for each column, x,y not included 
                              x,y is calculated using llcorner = Left/Bottom + half cell size

Save data image: 2013DEM_AreaA.png

LaGriT Finite Element Mesh 

Save data description: 2013DEM_AreaA_about.txt

  The full description gives useful information and includes values that are needed 
  for creating and checking the ASCII elevation grid.
  The extents are used as translation points. Note that xllcorner=Left, yllcorner=Bottom.

  Raster_Information 
  Columns_and_Rows 808, 836
  Cell_Size__X._Y_ 0.25, 0.25
  Uncompressed_Size 2.58 MB   
  Format TIFF   
  Extent
  Top 7910563.5   
  Left 585455.25   
  Right 585657.25   
  Bottom 7910354.5 
  Spatial_Reference NAD_1983_UTM_Zone_4N 
  Linear_Unit Meter (1.000000)   
  Angular_Unit Degree (0.0174532925199433)   
  False_Easting 500000   
  False_Northing 0   
  Central_Meridian -159   
  Scale_Factor 0.9996   
  Latitude_Of_Origin 0   
  Datum D_North_American_1983 

Create x-y-z file 2013DEM_AreaA.txt (preferred)

  These data are the explict x,y,z points of the data cell centers. This is useful
  for avoiding ambiguity when combining the elevation data with polygons and other
  features located with respected to the elevation data.

  (1) Convert "raster TIF" to "shapefile points". 
  "ArcToolbox" -> "Conversion Tools" -> "From Raster" -> "Raster to point" 
  This will create a column called "GRID_CODE" (or something like that).

  (2) In the new "point shapefile", add a new field (i.e., column) called "x" and "y". 
  Make them "Double" and give them at least three decimal places.

  (3) Fill out x and y coordinates. 
  Open the "point shapefile" attribute table, highlight the x column, 
  right-click and selected "Calculate Geometry". 
  Do the same for y.

  (4) Create a new field called z. 
  Using the "Field Calculator" in the attribute table, make the z values equal to the column "GRID_CODE".

  (5) Open the *.dbf file for the "point shapefile" (e.g., using Excel). 
  Export the file to tab-delimited text file.

  Caution. Make sure the ArcMap document is in the correct projection. 
  If you add the "Raster TIF" before any other layer in a new document, the document should pick the correct 
  projection and cell sizes. 
  And remember that the "point shapefile" is a list of points at the raster cell centers.

  2013DEM_AreaA.txt:
    POINT X   Y  Z 
    1	585455.375	7910563.375	5.08
    2	585455.625	7910563.375	5.08
    3	585455.875	7910563.375	5.05
    4	585456.125	7910563.375	5.03
    5	585456.375	7910563.375	4.99
    ...

  NOTES:
  The precision should be truncated to actual value, do not include garbage digits past the precision.
  The number of points should be equal to number of columns X rows.
  The min x,y of these points should be extent Left,Bottom + half cell size.
  The max x,y of these points should be extent Right,Top - half cell size.

Create ascii elevations 2013DEM_AreaA.asc (optional)

  Use: "ArcToolbox" -> "Conversion Tools" -> "From Raster" -> "Raster to ascii"
  Assuming the original TIF was added first, then you can go with the defaults
  (defaults include cell size, extent, and projection).
  Remember the extents are cell range, elevations are at cell center.

  2013DEM_AreaA.asc (x,y calculated from extents and cellsize):
    ncols         808
    nrows         836
    xllcorner     585455.25
    yllcorner     7910354.5
    cellsize      0.25
    NODATA_value  -9999
    5.08 5.08 5.05 5.03 4.99 4.96 4.94 4.92 4.86 4.85 ... (very long lines)