Rochelle G. Williams

Non-Linear Surface Interpolations:

Which Way Is The Wind Blowing?



ABSTRACT

Geographic Information System (GIS) surface interpolations are pure linear calculations, but many nonlinear geographic phenomena exist in the real world. A compass, with 360 degrees, describes a nonlinear situation. The same final direction may be reached by moving in either a clockwise or a counterclockwise direction. How can nonlinear conditions be modeled in linear-restricted programs? Translation functions may be used successfully, but care must be taken when designing the model. Potential conflicts and sign problems await the unwary GIS analyst. This paper uses the specific example of calculating two-dimensional wind directions over flat terrain to illustrate the pitfalls and pinnacles of nonlinear interpolations.


 1.0 INTRODUCTION

While interpolating wind fields between weather monitoring stations, a series of difficulties were encountered due to the non-linear nature of wind direction. This paper discusses the specific problems and solutions found while programming the ArcView script and during subsequent model testing. Non-linear scripting issues will share certain characteristics and this discussion may assist others to avoid certain pitfalls while working toward specific application solutions. Throughout this endeavor, three distinct perspectives were needed to successfully create the non-linear model - that of a technical expert, a mathematician, and obviously, a GIS analyst.

Within the area of atmospheric computer models, GIS is not a common analysis methodology. This is partly due to the history of atmospheric model development, (Jacobson, 1999), and partly due to inherent difficulties of linear restricted GIS programs. This paper represents initial steps to assist linear restricted GIS users begin working with non-linear atmospheric processes. GIS atmospheric modeling frequently utilizes classic atmospheric modeling programs for numeric analysis and the results are exported into a GIS for display, (Kvaal et al., 1998; Patterson, 1997; Tchepel et al., 1997). This method uses GIS as a map-making tool. This is only a small part of the power and benefit of GIS. Works by Shipley, van der Wel and the Air Force Combat Climatology Center use GIS as an analysis tool, (Rabayda, 1997; Shipley and Graffman, 1998; Shipley et al., 1997; van der Wel, 1997). Geospatial analysis and geostatistics are powerful methods in their own right and bring a new dimension to scientific analysis - the ability to analyze data based on spatial attributes and relationships.

Within atmospheric modeling, wind fields are important to understand how the wind flows through a given area. Wind speed and direction are calculated at points between monitoring stations to provide the information. Why is wind interpolation using GIS a problem? Wind direction is a non-linear attribute. ArcView is restricted to linear surface interpolations. Figure 1 diagrams examples of linear and non-linear systems. When moving from one number to another, the linear system has only one path. To go from 1 to 5, the linear system moves through 2, 3, and 4. To go from 5 to 1, the same steps, in opposite order are taken. No other choice exists for a linear system. The essence of a non-linear situation is that multiple choices exist. To go from 45o to 270o, two paths exist for the diagramed example. Steps include moving through either 90 o, 135 o, 180 o, 225 o or 0 o, 315 o. Both paths move from the original 45 o to the final 270 o, but both paths are unique. This is the fundamental nature of a non-linear system.

Many issues complicate scripting a nonlinear GIS model. To demonstrate the major ones encountered during development of a two-dimensional simple terrain wind flow field, the same sample data set will be used throughout the paper, Figure 2. Five wind monitoring stations are identified; each has the same wind speed but different wind directions. It is important to test scripts under development with data where the programmer knows what the results should be. Test results that deviate from the desired results will point toward non-linear scripting obstacles. Most people have a general understanding of how wind should blow. Therefore, by inspection we know that the example wind should blow generally toward the center of the wind field from the northwest, the southwest and the southeast, and generally exit to the east and northeast. This is the desired result for a two dimensional, smooth terrain wind field.
 
 

2.0 LINEAR INTERPOLATION OF THE WIND

Using the sample data set, a linear ArcView Spatial Analyst surface interpolation is run with results shown in Figure 3. Generally, the results agree with our basic understanding of what should happen for both the north and west sections. However, results in the southeast section do not agree with our basic understanding. The black arrows are the original monitoring station wind directions and the short, white arrows give the general wind direction corresponding to each interpolated wind direction range color. As can be seen in the southeast corner, the arrows rotate linearly. The long looping arrow demonstrates how the wind supposedly curls about itself, rotating through almost 270o, before matching the monitored wind direction. Because of our basic understanding of what the interpolated wind field should be, we know this result is not correct.

The following sections describe the major problems encountered during creation of the nonlinear surface interpolation program. The solutions to each problem are described in the hopes that other developers can use or adapt these solutions to their specific applications and hopefully decrease the time from idea conception to working script.
 
 

3.0 OBSTACLES

3.1 Non-Linear Transformations

The first thing to realize is a non-linear transformation involves a good deal of math - so get over any math anxiety you may have. While the transformation is complicated, the issues that arise are more from the quantity of details rather than from complexity of the math itself. For our specific example, high school level geometry and trigonometry are used. Other applications could use higher levels of mathematics such as calculus or Fourier transforms. The type of math used in the transformation depends upon the specific application.

 3.2 Terminology Issues 

Terminology differences between the physical phenomenon being modeled and the GIS environment can be an obstacle when modeling non-linear characteristics. For the example winds, there is a difference between the National Weather Service wind data and the vectors used within the model. Not only are directions calculated differently, but they mean completely different things, Figure 4. A vector gives magnitude and direction from a single arrow symbol. The length of the arrow corresponds to the vector's magnitude, which in our example is wind speed. The arrow's direction, measured counterclockwise from the right horizontal, gives wind direction. A wind barb is actually three symbols combined and may be interpreted to provide a variety of data, (Lutgens and Tarbuck, 1995). The small circle describes the cloud cover condition, such as clear or obscured skies. The long line tells whether there is any wind and the direction from which it is blowing. The small lines on the end of the long line give the approximate wind speed. Direction the wind is blowing is measured clockwise from the vertical.

There is a fundamental concept difference between a wind barb and a vector. A wind barb is a description of what a weather monitoring station is detecting as the wind blows around it, Figure 5. In mathematical terms, this is an Eulerian system, (Batchelor, 1994), and describes the spatial distribution of the wind surrounding the monitoring station at any specific time. A vector describes the actual wind as the air parcel moves and changes through both space and time. This is a Lagrangian system. It is important conceptually to not mix Eulerian and Lagrangian systems in mathematical calculations because they describe different situations. In the wind example, mixing the two systems causes an immediate difference of 180o but of even greater importance are complications in geometry and tracking which perspective applies at different times during the script troubleshooting process.  These complications are self-inflicted and should be avoided.

The model under development within this paper is a two dimensional, smooth terrain wind interpolation scheme. As such, it generates a diagnostic wind field - a snapshot in time. Diagnostic wind fields may not be well known to those whose familiarity with atmospheric science is limited to weather forecasts. However, diagnostic fields are used occasionally and it is a necessary starting point for further non-linear GIS model refinement. The more commonly known weather forecasts use prognostic or prediction models, (Jacobson, 1999). Other temporal models include back trajectory analyses that identify where wind or pollution sources originated.

3.3 Convention Confusions

As mentioned in the introduction, different perspectives are necessary for successfully modeling a non-linear phenomenon. One of the first issues to be faced is rotation convention differences, Figure 6. For the three conventions shown, each has perpendicular axes that point toward the east or x-axis, and the north or y-axis. From a pure mathematical perspective, positive rotation is typically measured counterclockwise from the x-axis. GIS convention positive rotation is clockwise from the y-axis. Care must be taken when designing equations to consider these differences. Within ArcView itself, rotation discrepancies exist. Symbol rotation in the ArcView menu Window/Show Symbol Window is counterclockwise from the positive y-axis, exactly opposite normal GIS rotation convention.

The three rotation situations also show a difference with respect to location of the origin or 0o.While this may sound quite basic, it is a serious obstacle for unwary scriptwriters. From a math perspective, 0o is the east or positive x-axis. In ArcView, both the normal rotation and symbol rotation use 0o as the north or positive y-axis.If an incorrect origin is assumed, diagram and equations will produce inaccurate results.

Additional conventions exist concerning angle measurements within GIS.When discussing directions or angles within a map or GIS layer, compass directions are given in degrees. However, some computer math functions require angles to be in radians rather than degrees. This is the case for ArcView math functions.Simple modifications to any equations will correct this problem and produce results in the desired units.It is convenient to remember that 180op radians and the table below shows corresponding radians and degrees for common angles.

Radians

Degrees

0

0

p/4

45

p/2

90

p

180

2p

360

Convention differences play an important role when designing a GIS model.  As can be seen, depending on the perspective at any time during model troubleshooting, conflicting conventions can cause confusion.

 

 

 4.0 SETTING UP FOR THE TRANSFORM

4.1 Pure Mathematics

The best transformation is a simple transformation. Analyze your specific non-linear situation for simple mathematic substitutions. Simple is best because it typically limits the number of details you will encounter. For our specific example, one vector at each monitoring site gives two pieces of information-wind speed and wind direction. Wind speed is linear and does not need transformation. Wind direction is non-linear and must be transformed.Using geometry, a vector can be separated into axial components, Figure 7. The magnitude of the vector is represented by the variable H and the direction is given by q. The axial components are given by

X = H Cos q

(1)

Y = H Sin q

(2)

4.2 ArcView Math

Because of convention differences between pure mathematics and GIS, equations (1) and (2) must be compared and transformed into GIS conventions. While pure mathematics define the transformation formulas, the angle and rotation definitions must conform to GIS standards. Because of the operating environment ArcView, the angles used by the ArcView math functions use GIS conventions. To illustrate this point, Figure 8 diagrams the mathematical transformation situation shown in Figure 7 in GIS normal conventions. Of importance is not only the difference in rotation but the change in the formula. The equations actually reverse! The GIS convention corrected transformation equations are

X = H Sin q

(3)

Y = H Cos q

(4)

This is a good example why documenting process analysis and transformation equations are important. In addition, an excellent visualization tool is graphing diagrams of all relationships. This is especially advantageous in the areas of rotation conventions. If equations (1) and (2), were used for the ArcView linear analysis, the results would be unrealistic. Therefore, when creating a non-linear surface interpolation, be sure to transform the mathematically derived equations into GIS conventions.


 
 

5.0 EXECUTE THE LINEAR ANALYSIS

At this point, the non-linear wind vector has been successfully transformed into linear vector components in the x and y directions. Normal ArcView Spatial Analyst surface interpolations may be used to create interpolated wind fields - one for the northern wind component and one for the eastern wind component. Within ArcView, multiple types of linear interpolations are possible. This paper does not present comparisons between the interpolation types; references that provide general information on this subject include Hu and Isaaks. Different interpolation types lend themselves to various applications.A later section in this paper does provide a comparison and details potential decisions that a scriptwriter will make.
 
 

6.0 TRANSFORM LINEAR COMPONENTS BACK INTO NON-LINEAR FORM

6.1 Pure Mathematics

The desired result of the script is a non-linear interpolated wind field.At this point, we have two separate grids, northern wind and eastern wind. Each grid gives an axial wind component value for the same grid cell location.In Figure 9 the northern wind is designated Y’ and the eastern wind is X’. To combine the wind components into the desired result involves mathematical calculations. From geometry, the magnitude of the vector, the wind speed, is calculated as

|S| = (X’2 + Y’2)1/2

(5)

and the vector direction or wind direction is given by

a = Tan-1(Y’/X’)

(6)

Note equation (5) has an absolute value. Does this complicate the back transformation? No, it does not. No matter if X' and Y' are positive or negative, the resultant wind magnitude is always positive due to the squaring of the component vector terms. So how does ArcView know which way the non-linear wind vector should point?The wind direction, equation (6), provides that information. Once again, determining the angle involves careful consideration due to its non-linear nature. We will work through each non-linear issue for the back transformation. From the initial transformation efforts, we know to check the mathematically derived equations against GIS conventions. However, before doing this step, additional concepts must be introduced.

6.2 Geometry Quadrants

It is important to know the signs of the wind component vectors because they indicate the positive or negative axis direction. Figure 10 illustrates a single vector with axial components. Depending on the vector’s quadrant, the axial components take on different signs. Quadrants are geometric nomenclature that define sections within the graph and are designated by roman numerals in the figure. Quadrant I is bounded by the positive x and y axes and both vector components are positive. Quadrant II is bounded by the positive x and the negative y axes with the eastern wind component being positive and the northern wind component being negative. Similarly, Quadrant III is bounded by the negative x and y axes and both wind components are negative. The fourth quadrant is bounded by the negative x and the positive y axes and the vector components follow the same sign convention. The significance of the quadrant and sign conventions will be evident shortly.

6.3 Transformation Mathematics

Complications arise from equation (6) due to computer math function limitations and not due to convention conflicts. Figure 11(a) shows the domain that defines the inverse tangent, Tan-1, trigonometry function. Results are only valid between -p/2 and p/2; this is only half of the domain we need, Figure 11 (b). Therefore, including wind component signs is irrelevant because with or without them, the mathematic model does not encompass the full domain of the GIS region. The inelegant solution involves two steps - calculate wind direction based on absolute values, then rotate the angle to the correct quadrant. However, this solution does not work for all quadrants. Calculated values are only valid for the first and third quadrants. If a Quadrant I angle is simply rotated by 270o to translate into Quadrant IV, it is obvious why the simple translation does not work, Figure 12. Angles in the fourth quadrant are "mirror images" of the first quadrant angles and it can be proved that the fourth and second quadrant formulas are the same with a simple rotation needed for quadrant corrections. The same method as in Section 4.2 will be used to diagram angles and check derived equations. The solution to the problem is interesting and involves angle symmetry.

6.4 Angle Symmetry

Within geometry, certain rules govern certain geometric shapes. Within a triangle, the sum of all interior angles always equals 180o. If one angle is a right angle, equal to 90o, then the sum of the remaining angles is also 90o. Therefore, from Figure 13, we know

q + a = 90o

(7)

The angle q is defined by the lines AOB and a is defined by the lines OAB. If lines OB and DA are parallel, then the triangle OAB and ODA have the same included angles. Therefore, the angle defined by DAO is equal to q and the angle AOD equals a. This is also demonstrated by the fact that line AB is perpendicular to both lines OB and DA. A right angle is defined by the lines DAB. If a is included within angle DAB, then from (7)

q = 90o - a

(8)

So it is possible to identify angles based on symmetry using known angles and parallel lines. Angle DAO equals q and angle AOD equals a. This can be extended to other quadrants. For example, Quadrant III of Figure 13 gives q by symmetry using the horizontal axis and line COA. Therefore, the angle defined by the line CO and the vertical axis must equal a. It is left to the reader to investigate angle symmetry within the other quadrants. Angle symmetry can be used to re-diagram quadrants two and four; only Quadrant IV is shown, Figure 14.Quadrant II is re-defined similarly.Derived equations for each quadrant to back translate wind direction are given below. Once again, we see a reversal in equations to reach our desired answer. Within the ArcView script, a conditional “If statement” that uses wind component signs will allow the model to select the correct equation.

Quad I

q = Tan-1(X’/Y’)

(9)

Quad II

q = Tan-1(Y’/X’) + 90o

(10)

Quad III

q = Tan-1(X’/Y’) + 180o

(11)

Quad IV

q = Tan-1(Y’/X’) + 270o

(12)

As discussed earlier, be sure the trigonometric function is working with radians, rather than degrees at this point. The trigonometric functions in ArcView will not recognize degrees. You may use a conversion such as p/180 to convert from degrees to radians within the script or the database information may be modified before beginning actual calculations.


 
 

7.0 THE LAST CHECK

7.1 Sanity Checks

Finally, the last check relies on a scriptwriter's ability to understand the phenomenon that is being modeled. Each time a transformation glitch is fixed, it is important to give the results a "sanity check". Always use test data. By knowing the answer before the computer finishes crunching the numbers ensures rapid analysis of the results and facilitates positive progress with model development. Test data specific for each quadrant should be used before checking a general test model. As discussed earlier, the different quadrants present analysis and programming challenges that must be addressed within a successful model. By using test data specific to each quadrant, it is possible to check the equation results to ensure the diagramed angles discussed earlier are correctly interpreted. By using the different perspectives of technical expert, mathematician and GIS analyst, sanity checks are quick methods to see if the programming is proceeding in a positive direction. A technical expert understands the trends of the phenomenon being modeled. A mathematician tests formulas with data where the correct answer is already known.And a GIS analyst is key to developing the methodology.Together, these different disciplines give the multidiscipline knowledge needed to create a non-linear interpolation script.
 
 

7.2 Interpolation Types and the Effects on Non-Linear Models

Once the non-linear model successfully interpolates the data, two non-linear grids will define a single vector. One grid gives wind speed, magnitude, and the other gives wind direction. Figure 15 shows the non-linear interpolation of wind direction for the sample data set. As discussed in the previous section, technical expertise is important to develop the best non-linear model possible. For those not familiar with atmospheric science, Figure 15 (a), may look acceptable. However, wind does not typically move so that "blobs" occur in the wind field. Note the corners and center of the figure which show large areas of the same general direction with relatively quick changes of wind direction between the "blobs". Figure 15 (b) gives a better interpretation of a wind field. These two diagrams use the same sample dataset, Figure 2, but give different results due to the interpolation technique used during the linear portion of this process. As discussed in Section 5.0, the type of linear interpolation used affects the outcome of the non-linear interpolation model. Figure 15 (a) was calculated using the Inverse Distance Weighted (IDW) method which "assumes that each input point has a local influence that diminishes with distance", (Esri, 1996). This method restricts the values at all points to always being within the bounds set by the monitoring site points. Figure 15 (b) used the Spline technique that fits a "minimum curvature surface" through the data points. This method allows "gently varying surfaces" to be modeled and does not restrict the maxima and minima within the interpolated field.
 
 
 
 

8.0 CONCLUSIONS 

It is possible to perform non-linear surface interpolations within a linear restricted GIS program such as ArcView with Spatial Analyst extension. Geometry and trigonometry are involved and the potential exists for higher level mathematics depending on the specific application. The most difficult obstacles are convention conflicts and detail confusions that can be overcome with proper documentation and diagramming. By using test data where the desired outcome is known, model comparisons can be performed rapidly. Sanity checks and using quadrant specific test data facilitates non-linear model development. Finally, during script development, troubleshooting issues from the three perspectives of technical expert, mathematician and GIS analyst will give insights to the pitfalls involved with non-linear surface interpolations within a linear restricted GIS program.

 

 

9.0    ACKNOWLEDGEMENTS

Thanks go to Dr. Jim St. John of Georgia Tech for pointing out the obvious during the initial stages of model development. It's amazing how dependent we become on technology to solve all our problems when sometimes going back to the basics gives the best results.

 

 

10.    APPENDIX

ArcView v3.1 and Spatial Analyst v1.1 were used for this project.

 

 

11.    ENDNOTES

An air parcel is the atmospheric equivalent of a water drop or dirt clump.

 

 

12.REFERENCES

Batchelor, G.K., 1994. An Introduction to Fluid Dynamics. Cambridge University Press, New York, 615 pp.

Esri, 1996. ArcView Spatial Analyst, Environmental Systems Research Institute, Inc., Redlands, 147 pp.

Hu, J., 1995. “Methods of Generating Surfaces In Environmental GIS Applications”, 1995 International Users Conference. Environmental Systems Research, Inc.

Isaaks, E.H. and Srivastava, R.M., 1989. Applied Geostatistics. Oxford University Press, New York, 561 pp.

Jacobson, M.Z., 1999. Fundamentals of Atmospheric Modeling. Cambridge University Press, New York, 656 pp.

Kvaal, A., Sanders, J. and Walikis, R., 1998. “Kodak Air Resources Evaluation System 2000 (KARES 2000): Air Quality Management using ArcView Geographic Information System”, Esri International User Conference. Environmental Systems Research Institute, San Diego California.

Lutgens, F.K. and Tarbuck, E.J., 1995. The Atmosphere: An Introduction to Meteorology. Simon & Schuster Company, Englewood Cliffs, New Jersey, 462 pp.

Patterson, W., 1997. “Integrating ArcView and the Spatial Analyst Extension with the PRISM Climate Expert System”, Esri 1997 International Users Conference. Environmental Systems Research Institute, Inc., San Diego, CA.

Rabayda, A.C., 1997. “Air Force Combat Climatology Center (AFCCC) Applications of ArcView GIS and ArcView Spatial Analyst”, Esri 1997 International Users Conference. Environmental Systems Research Institute, Inc, San Diego, CA.

Shipley, S.T. and Graffman, I.A., 1998. “ArcView GIS is a Weather Processing System”, Esri International User Conference. Environmental Systems Resource Institute, San Diego, California.

Shipley, S.T., Graffman, I.A., Beddoe, D.P. and Smith, M., 1997. “Rapid Integration of COTS GIS for Interactive Weather Processing”, 13th International Conference on Interactive Information and Processing Systems (IIPS) for Meteorology, Oceanography, and Hydrology. American Meteorological Society, Atlanta, GA.

Tchepel, O., Borrego, C. and Barros, N., 1997. “Using GIS in MesoScale Atmospheric Modeling”, Esri 1997 European GIS Users Conference. Environmental Systems Research Institute, Inc.

van der Wel, F.J.M., 1997. “Introducing GIS Technology at the Royal Netherlands Meteorological Institute”, Esri International User Conference. Environmental Systems Research Institute, San Diego California.


AUTHOR INFORMATION
 

Rochelle G. Williams

Environmental Engineer 

U.S. Army Forces Command

1777 Hardee Avenue 

ATTN:AFPE-ENE 

Fort McPherson, GA30330-6000 

fax:(404)464-7827 

e:mail:williaro@forscom.army.mil 

Graduate Student

Georgia Institute of Technology

School of Earth and Atmospheric Science 

Atlanta, GA 30332