The LAT file format consists of header information, a list of the XYZ coordinates, and a repeat list of just the Z coordinates. The LAT file requires additional memory for processing when compared to a GRD file, but a HeightField is scaled automatically and does not require a manual calculation.
Note: Voxler 3 and newer versions support importing Surfer grid files directly. Converting a GRD to LAT is only required for Voxler 2 and earlier versions.
- In Surfer, click Grids | Edit | Convert.
- In the Open Grid dialog, select your GRD file. Make note of the Size (# rows x # columns) and then click Open.
- In the Save Grid As dialog, change the Save as type to DAT XYZ grid (*.dat), give your file a name, and click Save.
- In the Export Options dialog, check the Don't export nodata nodes (blank nodes) box and click OK.
- Copy the template LAT file listed below (do not copy the underlined LAT Template title) and paste it into a text editor program like Notepad++ or Notepad.
- Change the Number of columns and rows from the current [9 7] to the values that you made note of in step 2.
- Open the DAT grid file in a text editor.
- Select all of the rows, and then copy and paste them where indicated in the template (Paste the XYZ values...).
- Copy lines 6 through the end of the DAT grid file and paste into the LAT file where indicated in the template (data values...).
- Open the DAT grid file in Excel as a space-delimited file, and then copy all of the Z values from the third column and paste them where indicated in the template (Paste the Z values...).
- Click File | Saves As.
- Set the Save as type to All Files (*.*) and then enter your filename, in double quotes with a .LAT file extension.
- Click Save.
- Open Voxler and use the File | Import command to load the LAT file into Voxler.
- Right click on the LAT in the Network Manager and click Graphics Output | HeightField.
Troubleshooting in Voxler to display the HeightField:
- Check your X, Y, and Z min and max values.
- Check your scale.
- You may need to apply a Transform module between the LAT and HeightField.
- If you still cannot see the HeightField, please email your LAT file and GRD file to email@example.com.
#!/usr/explorer/bin/explorer cxLattice plain 1.0 # nDim, number of dimensions.
2 # dims, the vector of dimensions (size of the array). # Number of columns and rows in the GRD file. 9 7 # nDataVar, number of data variables at each node. # 1 for just the Z value. 1 # primType, primitive type of data. # 1 is short int*2, 2 is long int*4, 3 is float*4, 4 is double*8. 4 # coordType, lattice type.
# 0=uniform, 1=perimeter or rectilinear, 2=curvilinear. 2 # nSteps, number of data structures in the file. 1 # nCoordVar (Curvilinear lattices only). 3 # coordinate values. # For uniform lattices, these are the bounding box coordinates. # For rectilinear (perimeter) lattices, these are the values of the edge points. # For curvilinear lattices, these are the node locations. # Paste the XYZ values below. Space delimited is OK. Delete the "..." ... #data values. Delete the "..." ... # Paste the Z values below. Delete the "..." ...
Updated August 16, 2018