Rx_
Nothing In Moderation
- Local time
- Today, 03:00
- Joined
- Oct 22, 2009
- Messages
- 2,803
Does anyone else work with US Western Land management?
One would expect this surveying formula could be found somewhere. Could not find it anywhere. If anyone has something like this, I would appreciate knowing about it. I have a lot of records to run this against tomorrow.
History
In the US, we have GIS in modern lat/long. But, land titles, rights, and descriptions are based on defined Counties, that contain Townships (36 square miles), that contain Sections (square mile), that are broken up into Quarters (quarter square miles), then into Quarter-Quarters (a quarter of a quarter square mile).
Thomas Jefferson (a dead President) had a program that staked (identified) the corners of each square mile. By Square, it isn't actually square due to that pesky curved Earth plus geographical boundaries like a river or an angry bear den. It is actually mostly square.
This vba code is very "approximate" and qualifies me as a Good Standing Member of the Flat Earth Society.
If you don't understand my attachment, here is a more detailed guide:
http://en.wikipedia.org/wiki/Section_(United_States_land_surveying)
One would expect this surveying formula could be found somewhere. Could not find it anywhere. If anyone has something like this, I would appreciate knowing about it. I have a lot of records to run this against tomorrow.
Code:
Option Compare Database
Option Explicit
Function QuarterQuarter(NSDirection As String, EWDirection As String, NSFt As String, EWFt As String) As String
' Rx Take Feet from boundry in Section (square mile) and determine the QuarterQuarter
Dim flgNSQuality As Boolean ' didn't use flags just yet
Dim flgEWQuality As Boolean
Dim flgNSftQuality As Boolean
Dim flgEWftQuality As Boolean
Dim intNSFT As Integer
Dim intEWFT As Integer
10 On Error GoTo ErrQuarterQuarter
' Check the data quality of the input first
20 If NSDirection = "FNL" Or EWDirection = "FSL" Then
30 flgNSQuality = True
40 Else
50 flgNSQuality = False
60 QuarterQuarter = "ErrFNL"
70 Exit Function
80 End If
90 If EWDirection = "FEL" Or EWDirection = "FWL" Then
100 flgNSQuality = True
110 Else
120 flgNSQuality = False
130 QuarterQuarter = "ErrFEL"
140 Exit Function
150 End If
160 If IsNumeric(NSFt) Then
170 If CInt(NSFt) < 0 Or CInt(NSFt) > 5280 Then
180 QuarterQuarter = "ErrNSFtL" ' outside limit
190 Exit Function
200 Else
210 intNSFT = CInt(NSFt)
220 End If
230 Else
240 QuarterQuarter = "ErrNSFt"
250 Exit Function
260 End If
270 If IsNumeric(EWFt) Then
280 If CInt(EWFt) < 0 Or CInt(EWFt) > 5280 Then
290 QuarterQuarter = "ErrNSFtL" ' outside limit
300 Exit Function
310 Else
320 intEWFT = CInt(EWFt)
330 End If
340 Else
350 QuarterQuarter = "ErrNSFt"
360 Exit Function
370 End If
' Take the North top row - then go west to east, then east to west
' Then take the 2nd North top row
' Note: while we cross track E/W (overlap) none of my data had N/S overlap
' To complete this code for all possiblities, it would need to double in size
' so if a survey went from the southern line north 5200 feet - this wouldn't work
' *********** North South *********************************************** EW
380 If NSDirection = "FNL" Then ' direction From North Line FNL
390 Select Case CInt(NSFt) ' feet From North
Case 0 To 1320 ' top North quarter halfs Top Row
400 If EWDirection = "FWL" Then ' from West direction top half
410 Select Case intEWFT ' feet From N/S Line
Case 0 To 1320
420 QuarterQuarter = "NWNW"
430 Case 1320 To 2640
440 QuarterQuarter = "NENW"
450 Case 2640 To 3960
460 QuarterQuarter = "NWNE"
470 Case 3960 To 5280
480 QuarterQuarter = "NENE"
490 Case Else
500 QuarterQuarter = "ErrNSFt"
510 Exit Function
520 End Select
530 Else ' from West direction top half
540 Select Case intEWFT ' feet From N/S Line
Case 0 To 1320
550 QuarterQuarter = "NENE"
560 Case 1320 To 2640
570 QuarterQuarter = "NWNE"
580 Case 2640 To 3960
590 QuarterQuarter = "NENW"
600 Case 3960 To 5280
610 QuarterQuarter = "NWNW"
620 Case Else
630 QuarterQuarter = "ErrNSFt"
640 Exit Function
650 End Select
660 End If
670 Case 1320 To 2640 ' 2nd Row across from North
680 If EWDirection = "FWL" Then ' from West direction top half
690 Select Case intEWFT ' feet From N/S Line
Case 0 To 1320
700 QuarterQuarter = "SWNW"
710 Case 1320 To 2640
720 QuarterQuarter = "NENW"
730 Case 2640 To 3960
740 QuarterQuarter = "SWNE"
750 Case 3960 To 5280
760 QuarterQuarter = "NENE"
770 Case Else
780 QuarterQuarter = "ErrNSFt"
790 Exit Function
800 End Select
810 Else ' from West direction top half FEL
820 Select Case intEWFT ' feet From N/S Line
Case 0 To 1320
830 QuarterQuarter = "SENE"
840 Case 1320 To 2640
850 QuarterQuarter = "SWNE"
860 Case 2640 To 3960
870 QuarterQuarter = "SENW"
880 Case 3960 To 5280
890 QuarterQuarter = "NWNW"
900 Case Else
910 QuarterQuarter = "ErrNSFt"
920 Exit Function
930 End Select
940 End If
950 End Select
960 Else ' can only be FSL From South Line FSL (from bottom) ******** from southern Line
970 Select Case NSFt ' feet From North
Case 0 To 1320 ' Bottom Row
980 If EWDirection = "FWL" Then ' from West direction top half
990 Select Case intEWFT ' feet From N/S Line
Case 0 To 1320
1000 QuarterQuarter = "SWSW"
1010 Case 1320 To 2640
1020 QuarterQuarter = "SESW"
1030 Case 2640 To 3960
1040 QuarterQuarter = "SWSE"
1050 Case 3960 To 5280
1060 QuarterQuarter = "SESE"
1070 Case Else
1080 QuarterQuarter = "ErrNSFt"
1090 Exit Function
1100 End Select
1110 Else ' from West direction bottom row
1120 Select Case intEWFT ' feet From N/S Line
Case 0 To 1320
1130 QuarterQuarter = "SESE"
1140 Case 1320 To 2640
1150 QuarterQuarter = "SWSE"
1160 Case 2640 To 3960
1170 QuarterQuarter = "SESW"
1180 Case 3960 To 5280
1190 QuarterQuarter = "SWSW"
1200 Case Else
1210 QuarterQuarter = "ErrNSFt"
1220 Exit Function
1230 End Select
1240 End If
1250 Case 1320 To 2640 ' 2nd Row from Bottom
1260 If EWDirection = "FWL" Then ' from West direction top half
1270 Select Case intEWFT ' feet From N/S Line
Case 0 To 1320
1280 QuarterQuarter = "NWSW"
1290 Case 1320 To 2640
1300 QuarterQuarter = "NESW"
1310 Case 2640 To 3960
1320 QuarterQuarter = "NWSE"
1330 Case 3960 To 5280
1340 QuarterQuarter = "NESE"
1350 Case Else
1360 QuarterQuarter = "ErrNSFt"
1370 Exit Function
1380 End Select
1390 Else ' from West direction second from bottom south FEL (east to west)
1400 Select Case intEWFT ' feet From N/S Line
Case 0 To 1320
1410 QuarterQuarter = "NESE"
1420 Case 1320 To 2640
1430 QuarterQuarter = "NWSE"
1440 Case 2640 To 3960
1450 QuarterQuarter = "NESW"
1460 Case 3960 To 5280
1470 QuarterQuarter = "NWSW"
1480 Case Else
1490 QuarterQuarter = "ErrNSFt"
1500 Exit Function
1510 End Select
1520 End If
1530 End Select
1540 End If
' debug.print "Made it to the end"
'QuarterQuarter = "NWNW" ' just for testing
1550 Exit Function
ErrQuarterQuarter:
MsgBox "trapped error, still needs skined and tanned"
End Function
History
In the US, we have GIS in modern lat/long. But, land titles, rights, and descriptions are based on defined Counties, that contain Townships (36 square miles), that contain Sections (square mile), that are broken up into Quarters (quarter square miles), then into Quarter-Quarters (a quarter of a quarter square mile).
Thomas Jefferson (a dead President) had a program that staked (identified) the corners of each square mile. By Square, it isn't actually square due to that pesky curved Earth plus geographical boundaries like a river or an angry bear den. It is actually mostly square.
This vba code is very "approximate" and qualifies me as a Good Standing Member of the Flat Earth Society.
If you don't understand my attachment, here is a more detailed guide:
http://en.wikipedia.org/wiki/Section_(United_States_land_surveying)