7.7 lattice.for

This program allows to generate lattice coordinates in an ASCII-file containing a running ID, X, and Y values. This is specifically helpful to design a regular point lattice for generating point files in ArcInfo that can be used to sample grid coverages (without interpolating when sampling lattices using LATTICESPOT). Often, we need to sample a series of grids in a regular manner, and we would like to have the points ave a certain ararangement. The program lattice enables to design such an ASCII-file that can easily be imported and overlaid using e.g. LATTICESPOT.

Be aware that LATTICESPOT does interpolate between adjacent cells if the points are not exactly located in the center of the sampled cell. There is a free AML to download from ESRI's hompage that enables to sample grids into a point file without interpolations. The AML is called GRIDSPOT (or GRIDSPT7, respectively).

When the program is started, the following qustion are asked:

where: X-min and Y-min are the points X- and Y-coordinates (in map units) of the lower left pixel or edge of the rectangular area to be designed with the point lattice; X- and Y-Increments are the distance between the points (in map units) along the two axes; and the # of columns and rows are the respective number of points along the two axes.

The program creates a file called <coord.dat>, which contains the newly gnerated coordinates. This file can be imported into ArcInfo easily using the generate command in the ARC-module:

   arc:\>generate new_ptfile
   arc:\>input coord.dat
   arc:\>points
   arc:\>quit
   arc:\>build new_ptfile points

When designing a lattice to the extent of an existing grid, you should know that the describe command in ARC (or GRID) gives you all the information necessary to answer the above questions. Be aware however, that the reported lower left coordinates are the absolute lower left of the grid cell (edge), not of the center of this cell. To get the center of the lower left cell, you should add half of the cell size to both the X- and the Y-coordinate. Also, there might be NODATA cells at the edges of the grid. If tis happens, then you would generate a lattice that covers the whole grid, but one that covers a larger area than the one containing actual data values.

The last thing you should be aware is that files can become very large if e.g. a few thousand rows and columns are entered each. If you need to sample an overly large area, it might be a better idea to split the whole study area into pieces and sample them sequentially. The lattice program facilitates this approach.


General specifications of the AML:

Command: lattice
Required input: none
Output units: map units
Speed of calculations: very fast
Flexibility of the routine: can be used for other, more complex programs
User interface: very simple
Known errors:  -
Programmer N.E. Zimmermann
Download Source Code: lattice.for       (use: "save link as")
Download DOS-compiled: lattice.exe      (use: "save link as")
Download UNIX-compiled: lattice             (use: "save link as")
Contact: niklaus.zimmermann @ wsl.ch

 

References:

 

[top] [back] [home]

Last Updated: 3/04/2000
By Niklaus E. Zimmermann