|
|
||||||||
a Dep. of Crop and Soil Sciences, Plant and Soil Sciences Building, Michigan State Univ., East Lansing, MI 48824-1325 USA
gerakis{at}pilot.msu.edu
| ABSTRACT |
|---|
|
|
|---|
| INTRODUCTION |
|---|
|
|
|---|
|
This paper presents a new computer program for textural classification. It can be used interactively on the World Wide Web or as a Windows 95 console program for batch processing of soil analysis results. It is possible to compile the code (available to download) on other operating systems with a Fortran compiler. The output of the program is a text file that can be readily imported to spreadsheets.
| Program Description and Operation |
|---|
|
|
|---|
Several point-in-polygon algorithms have been developed for spatial analysis applications such as computer cartography and geographic information systems (GIS) (Haralick, 1980; Nordbeck, 1962; Nordbeck and Rystedt, 1967) and more recently for World Wide Web image maps. A web image map allows the user to access additional information by pointing the cursor at unique polygons within the map and clicking. There are several point-in-polygon algorithms in the public domain available on the World Wide Web: Galacticomm's inpoly (http://www.gcomm.com), Apache's pointinpoly (http://www.apache.org/dist/), World Wide Web Consortium's inside-poly (http://www.w3.org/pub/WWW/Daemon/Implementation/HTImage.c), General Electric Manufacturing Technology Laboratory's inPolygon (ftp://ce-toolkit.crd.ge.com/pub/tcl/tcl-www.tar.gz), and Woods Hole Oceanographic Institution's inside (ftp://acoustics.whoi.edu/pub/Matlab5/oceans/inside.m). Of those, we preferred Galacticomm Technologies' algorithm (Stein, 1997) for its simplicity, conciseness, and because it avoids division. Division is a programming nuisance because the denominator should always be checked against zero.
The algorithm counts the number of times a vector extending from the test point and parallel to the positive y-axis crosses an edge of the polygon. If the count is even or zero, the test point is outside the polygon. If the count is odd, the point is inside the polygon. For example, the vector V extending from point A crosses one edge of the polygon "sandy loam"; therefore, point A is inside the polygon (Fig. 1). The same vector crosses two edges of the polygon "sandy clay loam"; therefore, point A lies outside that polygon.
Figure 2 illustrates a simple case of how the algorithm works. Let ABCD be a polygon, T the test point, and V the vector extending from T parallel to the positive y-axis. First, the algorithm performs a "straddle test": Segment AD must straddle vector V. The test result is affirmative if the abscissa of T is greater than the abscissa of A and less than the abscissa of D. Second, the algorithm performs the "north test" to determine whether segment AD straddles the vector north of T. The test result is affirmative if the slope of segment TA is less than the slope of segment AD. If both the straddle test and the north test are affirmative, then the algorithm counts one successful crossing. The same procedure repeats for the other polygon edges. The algorithm starts assuming that the point is outside the polygon, and complements this assumption with each crossing. In this example there is only one crossing, so point T is inside polygon ABCD.
|
The coordinates of all polygon vertices in the USDA triangle were coded into internal arrays within the program. The program reads the sand and clay content of a soil sample from a file. These are the x,y coordinates of the test point. The program iteratively evaluates the test point location, against the internal arrays containing the textural triangle polygon vertices, until the correct textural class polygon is determined. The textural class is then written to a file.
The program exists as an interactive World Wide Web application and as a Windows 95 console program. On a 133 MHz Pentium microcomputer the Windows version takes about a second to classify 1000 soil samples. To use the Windows version, the user must prepare an input file with two columns, in free format: the first column is sand percentage, the second is clay percentage. Sand and clay contents must be positive numbers. The output is a text file with the textural class for each sample.
| System Requirements and Availability |
|---|
|
|
|---|
Received for publication July 24, 1998.
| REFERENCES |
|---|
|
|
|---|
This article has been cited by other articles:
![]() |
J. J. Gurdak, M. A. Walvoord, and P. B. McMahon Susceptibility to Enhanced Chemical Migration from Depression-Focused Preferential Flow, High Plains Aquifer Vadose Zone J., November 1, 2008; 7(4): 1218 - 1230. [Abstract] [Full Text] [PDF] |
||||
![]() |
C. J. Kucharik and K. R. Brye Integrated BIosphere Simulator (IBIS) Yield and Nitrate Loss Predictions for Wisconsin Maize Receiving Varied Amounts of Nitrogen Fertilizer J. Environ. Qual., January 1, 2003; 32(1): 247 - 268. [Abstract] [Full Text] [PDF] |
||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| HOME | HELP | FEEDBACK | SUBSCRIPTIONS | ARCHIVE | SEARCH | TABLE OF CONTENTS |
| The SCI Journals | Agronomy Journal | Crop Science | |||
| Journal of Natural Resources and Life Sciences Education |
Vadose Zone Journal | ||||
| Journal of Plant Registrations | Journal of Environmental Quality |
The Plant Genome | |||