Click here to Skip to main content
15,886,199 members
Articles / Programming Languages / Visual Basic
Article

Simple Traverse Calculator

Rate me:
Please Sign up or sign in to vote.
4.00/5 (1 vote)
18 Feb 2011CPOL6 min read 44.1K   832   8   1
Calculate traverse for Surveying or Geologic mapping.

This is a very simple to use macro written in Excel VBA for calculating and redistributing the error vector to close a traverse.

Background

I wrote this program for my geologic field methods class. A traverse is a simple way to plot points of interest on a 2D map. When in the field, you may not have, or want to carry, appropriate surveying equipment or may not need that level of accuracy, so you can pace from point to point measuring the compass bearing and counting number of paces. You must close the traverse by returning to the original (starting) station or point. You will need to have your conversion factor calculated to feet per pace. One way of doing this is measuring out a known distance, say 100 feet, and count the number of paces. Then take 100 feet divided by your count. A pace is two steps. Start with your left and count every time your right foot makes contact with the ground. Also, bearings must be in azimuth (0 to 360 degrees). Refer to any geologic field book for more information.

Using the Code

Download the batch file (SimpleTravCalc1.bas). Open Excel and enable the developer tab in excel options. Click the visual basic button. Right click "This Workbook" and import file.

Once the file is loaded, return to Excel. Click macros and run SimpleTravCalc1. Make sure you start with a blank excel file.

It is easiest to use if you have your notes setup in the same order as the input boxes arise. Below is a summary:

For all traverses

  1. Title of your project

  2. Total number of traverses (each traverse creates a new sheet)
  3. Conversion factor
    1. There is no conversion calculator here. That should be done before entering field.

    For each traverse (for next loop)

  4. Number of vectors in traverse, or number of stations would be the same.
  5. Station occupied (only for first station, this is the point you will close to).
  6. Station sighted
  7. Forward bearing
  8. Reverse bearing
  9. Paces

Below is a sample of a 21 station traverse I recently did and how is set up in my field book.

occupiedsightedforwardreversepaces
161014822812.5
1011419688
14835517810
813201972.5
1311265796.5
111729711210.5
1771353154.5
76712505.5
6sd131013012.5
sd119792596
1910528510512
1054229498.5
411653452.5
15752498.5
5lp12011810.5
lp1182273611.5
1839027013.5
315283965
152015533210
20mh13621914.5
mh1161823596

Here is how to use it for those less inclined to code. If you set up your notes is this manner, you just need to read across from left to right, ignoring the occupied station after the first entry. It will automatically copy down. The angle given, theta_A, is the average of the forward bearing and the reverse bearing in the quadrant of the forward bearing. The next value given is the distance, r, in feet (or whatever your conversion factor was) based on the number of paces; r = (conversion factor)*(number of paces). You will see X and Y components of the vector calculated which necessary for error vector calculation, but will be removed later. After you have typed in all values, you’re done. Let the program continue to work through and the output is a corrected bearing, theat_C, and corrected distance, r_C, after error vector distribution. Now you have a closure error of zero. The most important thing is the percent error. If your error is high, you may want to go traverse your points again and check your bearings. Also, check that your forward bearing minus your reverse bearing is approximately plus or minus 180 degrees. Below is an example of the final product from the data given above.

OccupiedSightedtheta_Artheta_Cr_C
161014861.27548.039461.29694
1011419239.216191.862839.23018
148356.549.02356.652348.96217
81318.512.25519.3883412.24979
131126231.863261.794731.65447
1117294.551.471294.522251.18664
17713522.059134.646822.36208
7670.526.96171.0137827.25318
6sd131061.275310.134260.87207
sd1197929.41279.477229.81805
1910528558.824284.950658.30384
105422941.667228.306541.39813
4116512.255162.717712.6238
157241.66772.562542.18946
5lp1199.551.471198.707151.48856
lp118221.556.373220.775256.10527
1839066.17790.2422966.93403
315279.524.51279.104523.67116
1520153.549.02152.790249.68415
20mh137.571.07938.2296371.36235
mh116180.529.412178.695429.76824
   887.262  
      
      
Excercise 4    
traverse1     
Conversion Factor4.902   
Error Vector Magnitude10.97458   
Error Vector Direction110.5151   
Error Percent1.236904   

Important!!! This is a very simple macro and still needs much work, especially in error handling and handling user input error. If you screw up, start over. I will do my best to keep developing it until it is something more user friendly and a nicer GUI.

In the future, I will update this page to include code snippets and how they work, especially in error vector calculation and error vector distribution.

Points of Interest

The macro is very simple and not very "pretty." Future developments include a more comprehensive dialog box to include the options for paces or distance (if using a measuring tape). Two other calculators are yet to be written: one to convert from quadrant bearings to azimuthal and one for calculating conversion factor if not yet calculated.

Future development projects hope to include creating false X and false Y coordinates, searching through all traverse worksheets and averaging X Y coordinates for repeated stations in multiple traverses. After false X and false Y coordinates are calculated relative to some (0,0) reference point, inputing GIS coordinates from a GPS receiver, recalculating new coordinates that would fit the GIS. I also hope to rebuild in Python for direct integration with GIS applications.

The overall objective is use statistics to make the best possible map, or locate points as accurately as possible.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralMy vote of 4 Pin
db_cooper195023-Mar-11 16:25
db_cooper195023-Mar-11 16:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.