Source Data Also see: DemMaker Java Tool?
Tins are pregenerated using a dem file. the format of the dem is from arcinfo, using the GRIDFLOAT command.
information about the format is shown below:
converts the values in a grid into a file of binary floating point numbers.
GRIDFLOAT <in_grid> <out_file> {item}
Arguments
<in_grid> - the name of the grid to be converted.
<out_file> - the output binary file to be created.
{item} - the item in <in_grid> to be converted. The default is VALUE.
Notes
The output file is an IEEE floating point format, 32 bit signed binary file.
Two outputs are created, [[br]]
* the binary floating point file, and
* an ASCII header file named <out_grid>.hdr
The ASCII file consists of header information containing a set of keywords.
The file format is:
<NCOLS xxx>
<NROWS xxx>
<XLLCENTER xxx | XLLCORNER xxx>
<YLLCENTER xxx | YLLCORNER xxx>
<CELLSIZE xxx>
{NODATA_VALUE xxx}
BYTEORDER <MSBFIRST | LSBFIRST | VMS_FFLOAT>
where xxx is a number, and the keyword NODATA_VALUE is always written out as -9999.
If you wish the value of NODATA_VALUE to be something other that -9999, convert NODATA to the desired value
with the ISNULL and CON functions. Convert the grid to a floating point file with GRIDFLOAT. Change the value of
NODATA_VALUE in the ASCII header file to the value that NODATA was converted to.
The NODATA_VALUE is the value in the output file assigned to those cells in the input grid which contain the cell
value, NODATA. This value is normally reserved for those cells whose true value is unknown.
GRIDFLOAT only writes the origin out in LLCORNER. LLCENTER or LLCORNER will work with FLOATGRID.
the tin program will take in an upper left x and y coordinate, as well as a tile width. it will then go to the dem file and grab all of the values that lie in those extents. once it has those values it runs 1 of two algorithms (specified in the command line), a max points or a significance point elimination.
POINT ELIMINATION Both of these algorithms begin by giving a significance to each dem point, significance is calculated by taking the perpendicular distance of each opposing point. max points takes the n maxpoints with the highest significance. significance drops anything below the significance value.
in order to match up the edges of the dem files, the edge points are dropped in a seperate pass. edge points do not take into consideration inner points, so that the same points will be dropped for the next tile over. in the tin generation program a maxpoints/sig value can be set for the inner points, and the edges.
see http://www.geog.ubc.ca/courses/klink/gis.notes/ncgia/u39.html#SEC39.2.2 we implement - 2. VIP (Very Important Points) Algorithm
TRIANGULATION
once the points have been dropped, the are then triangulated using fortunes Fortune's algorithm.
NOTE: in the above sentence, "fortunes" refers to Steven Fortune's sweep triangulation algorithm.
which was popular in the late 1980s. it was described originally in TOMS or SIAM. the source code was originally
available from the old ATT/ORNL netlib site.
STRIPING next the triangles are organized into triangle strips, in order to improve performance. 4 algorithms are run against the triangles and the one with the least amount of seperate strips is used. the 4 algorithms are GREEDY,GENEROUS,HYBRID,LONGEST PATH
the first 3 are all similair, using a neighbor count to decide which triangle to move to next. GREEDY will move to the neighboring triangle with the most neighbors, etc.
longest path starts from each triangle and uses recursive calls to find the longest path. once all triangles have been used the algorithm is over.
FILE FORMAT a big endian binary file is written in the following ordered manner:
UL_X double(8) UL_Y double(8) Width int(4) NumPoints?? int(4) -points float(4)*NumPoints?*3 NumStrips?? int(4) -NumVerticies? int(4)*NumStrips? --vertex_index int(4)*NumVerticies?
ISSUES ABOUT CONTINUED USE
This solution relied on the creation of the dem data in ARCINFO. At the early development stage it was not and issue,
but if possible we should try to avoid having to use arcinfo to process the dem. It will also be difficult for clients
to match the same format if they are uloading newer areas, containing higher resolution data.
However, DEMs in the system have tended to be static. Once they were made, there was little change necessary,
same DEM could be used even though aerial images changed.
Some options may include:
- Reading from ASCII Grid, another more common ESRI Dem format, used to be old SPOT DEM format,
files can be large, but easy to work with and many people use it
- Making a tool to convert ASCII Grid into our "GRIDFLOAT" format, requires client to do something
- BIL as a Binary Dem, one binary file with a separate header, needs investigation
- 11bit or 16bit Tiff could be difficult to deal with as both are specialized TIFF formats
- others? -- open for suggestions USGS SDTS??
