I'm working with srtm dem files. They are ascii text files containing a table/grid of elevation values. At the top of the file is some metadata to locate the grid in lat/lon:
xllcorner -124.00041606132
yllcorner 48.999583599682
cellsize 0.00083333333333333
So initially I thought of the cells as points and assumed that the first value in the grid was the elevation for a point located at (xllcorner, yllcorner), and that the second value in the grid was the elevation at (xllcorner + cellsize, yllcorner). I then used this data to draw a 3d mesh with the mesh vertices corresponding to cells in the grid.
The resulting mesh looks correct but now I'm wondering if it's out by (cellsize / 2) in lat and lon...
When I started working with the file using Postgis Raster I discovered that it considers each cell as a polygon rather than a point. Rather than the first value representing the elevation for the point (xllcorner, yllcorner) it actually represents the the elevation for the polygon (xllcorner, yllcorner, xllcorner + cellsize, yllcorner + cellsize).
So, with that in mind, and seeing that I need to map each elevation to a point. Is it more accurate to say that the first value in the grid represents the elevation at (xllcorner, yllcorner) or at (xllcorner + cellsize / 2, yllcorner + cellsize / 2)?