def test_traverse3(): # closed at both ends and known bearing at one end pA5tra = Point("A5", 646333.5695, 276616.4171) pA11tra = Point("A11", 646502.8710, 276361.2386) pA4tra = Point("A4", 646284.6886, 276659.2165) oA5tra = PolarObservation('A5', "station") sA5tra = Station(pA5tra, oA5tra) oA5_A4tra = PolarObservation("A4", None, Angle("311-12-21", "DMS")) oA5_A6tra = PolarObservation("A6", None, Angle("136-36-49", "DMS"), Angle("100-13-22", "DMS"), Distance(58.405, "SD")) sA5tra.o.hz = Calculation.orientation(sA5tra, [[pA4tra, oA5_A4tra]])[0] assert compare(sA5tra.o.hz.get_angle('DMS'), '359-59-57') sA6tra = Station(None, PolarObservation('A6', "station")) oA6_A5tra = PolarObservation("A5", None, Angle("316-36-49", "DMS"), Angle("79-56-53", "DMS"), Distance(58.378, "SD")) oA6_A7tra = PolarObservation("A7", None, Angle("136-43-52", "DMS"), Angle("101-55-08", "DMS"), Distance(43.917, "SD")) sA7tra = Station(None, PolarObservation('A7', "station")) oA7_A6tra = PolarObservation("A6", None, Angle("316-43-52", "DMS"), Angle("78-21-53", "DMS"), Distance(43.878, "SD")) oA7_A8tra = PolarObservation("A8", None, Angle("141-48-30", "DMS"), Angle("102-29-18", "DMS"), Distance(48.459, "SD")) sA8tra = Station(None, PolarObservation('A8', "station")) oA8_A7tra = PolarObservation("A7", None, Angle("321-48-30", "DMS"), Angle("77-49-44", "DMS"), Distance(48.401, "SD")) oA8_A9tra = PolarObservation("A9", None, Angle("153-25-18", "DMS"), Angle("100-01-16", "DMS"), Distance(47.098, "SD")) sA9tra = Station(None, PolarObservation('A9', "station")) oA9_A8tra = PolarObservation("A8", None, Angle("333-25-18", "DMS"), Angle("80-17-11", "DMS"), Distance(47.040, "SD")) oA9_A10tra = PolarObservation("A10", None, Angle("153-59-32", "DMS"), Angle("97-46-19", "DMS"), Distance(58.077, "SD")) sA10tra = Station(None, PolarObservation('A10', "station")) oA10_A9tra = PolarObservation("A9", None, Angle("333-59-32", "DMS"), Angle("82-27-53", "DMS"), Distance(58.045, "SD")) oA10_A11tra = PolarObservation("A11", None, Angle("154-05-41", "DMS"), Angle("97-06-32", "DMS"), Distance(58.188, "SD")) sA11tra = Station(pA11tra, PolarObservation('A11', "station")) oA11_A10tra = PolarObservation("A10", None, Angle("334-05-41", "DMS"), Angle("83-09-29", "DMS"), Distance(58.151, "SD")) plist = Calculation.traverse( [[sA5tra, None, oA5_A6tra], [sA6tra, oA6_A5tra, oA6_A7tra], [sA7tra, oA7_A6tra, oA7_A8tra], [sA8tra, oA8_A7tra, oA8_A9tra], [sA9tra, oA9_A8tra, oA9_A10tra], [sA10tra, oA10_A9tra, oA10_A11tra], [sA11tra, oA11_A10tra, None]]) assert compare(plist[0], Point('A6', 646373.0353, 276574.6808)) assert compare(plist[1], Point('A7', 646402.4768, 276543.4174)) assert compare(plist[2], Point('A8', 646431.7153, 276506.2621)) assert compare(plist[3], Point('A9', 646452.4490, 276464.8193)) assert compare(plist[4], Point('A10', 646477.6637, 276413.1392))
def test_traverse2(): # closed at both ends and known bearings at both ends pKtra = Point("K", 599767.21, 148946.70) pVtra = Point("V", 599733.75, 149831.76) p1015tra = Point("1015", 598642.17, 148436.26) p1016tra = Point("1016", 600136.60, 148588.85) p1017tra = Point("1017", 600264.30, 149325.79) p1018tra = Point("1018", 598258.90, 149496.78) p1019tra = Point("1019", 600092.33, 150676.80) oKtra = PolarObservation('K', "station") sKtra = Station(pKtra, oKtra) oK_1017tra = PolarObservation("1017", None, Angle("61-28-18", "DMS")) oK_1016tra = PolarObservation("1016", None, Angle("142-53-28", "DMS")) oK_1015tra = PolarObservation("1015", None, Angle("254-23-32", "DMS")) oK_1tra = PolarObservation("1", None, Angle("17-14-18", "DMS"), None, Distance(139.82, "HD")) sKtra.o.hz = Calculation.orientation(sKtra, [[p1017tra, oK_1017tra], [p1016tra, oK_1016tra], [p1015tra, oK_1015tra]])[0] assert compare(sKtra.o.hz.get_angle('DMS'), '351-12-05') s1tra = Station(None, PolarObservation('1', "station")) o1_Ktra = PolarObservation("K", None, Angle("79-28-20", "DMS"), None, Distance(139.85, "HD")) o1_2tra = PolarObservation("2", None, Angle("236-13-46", "DMS"), None, Distance(269.32, "HD")) # o1_501tra = PolarObservation("501", None, Angle("204-58-10", "DMS"), None, Distance(59.12, "HD")) s2tra = Station(None, PolarObservation('2', "station")) o2_3tra = PolarObservation("3", None, Angle("82-18-45", "DMS"), None, Distance(169.40, "HD")) o2_1tra = PolarObservation("1", None, Angle("217-58-34", "DMS"), None, Distance(269.36, "HD")) s3tra = Station(None, PolarObservation('3', "station")) o3_2tra = PolarObservation("2", None, Angle("262-18-44", "DMS"), None, Distance(169.45, "HD")) o3_Vtra = PolarObservation("V", None, Angle("41-18-10", "DMS"), None, Distance(345.90, "HD")) # o3_502tra = PolarObservation("502", None, Angle("344-28-25", "DMS"), None, Distance(55.46, "HD")) oVtra = PolarObservation('V', "station") sVtra = Station(pVtra, oVtra) oV_3tra = PolarObservation("3", None, Angle("257-44-08", "DMS"), None, Distance(345.94, "HD")) oV_1018tra = PolarObservation("1018", None, Angle("346-24-11", "DMS")) oV_1019tra = PolarObservation("1019", None, Angle("112-12-06", "DMS")) oV_1017tra = PolarObservation("1017", None, Angle("222-50-58", "DMS")) sVtra.o.hz = Calculation.orientation(sVtra, [[p1018tra, oV_1018tra], [p1019tra, oV_1019tra], [p1017tra, oV_1017tra]])[0] assert compare(sVtra.o.hz.get_angle('DMS'), '270-47-46') plist = Calculation.traverse([[sKtra, None, oK_1tra], [s1tra, o1_Ktra, o1_2tra], [s2tra, o2_1tra, o2_3tra], [s3tra, o3_2tra, o3_Vtra], [sVtra, oV_3tra, None]]) assert compare(plist[0], Point('1', 599787.74865, 149085.0079)) assert compare(plist[1], Point('2', 599718.9691, 149345.3886)) assert compare(plist[2], Point('3', 599802.5094, 149492.7786))
def test_traverse1(): # closed at one end and known bearings at one end (free traverse) p5241otra = Point("5241", 646414.44, 211712.77) p5245otra = Point("5245", 646938.71, 212635.92) p5246otra = Point("5246", 646380.61, 212793.97) p5247otra = Point("5247", 646381.14, 212476.49) o5247otra = PolarObservation('5247', "station") s5247otra = Station(p5247otra, o5247otra) o5241otra = PolarObservation("5241", None, Angle("245-23-41", "DMS")) o5245otra = PolarObservation("5245", None, Angle("141-56-11", "DMS")) o5246otra = PolarObservation("5246", None, Angle("67-47-14", "DMS")) s5247otra.o.hz = Calculation.orientation(s5247otra, [[p5241otra, o5241otra], [p5245otra, o5245otra], [p5246otra, o5246otra]])[0] assert compare(s5247otra.o.hz.get_angle('DMS'), '292-06-34') o5247_111otra = PolarObservation("111", None, Angle("241-26-57", "DMS"), None, Distance(123.42, "HD")) s111otra = Station(None, PolarObservation('111', "station")) o111_5247otra = PolarObservation("5247", None, Angle("225-39-00", "DMS")) o111_112otra = PolarObservation("112", None, Angle("92-38-43", "DMS"), None, Distance(142.81, "HD")) s112otra = Station(None, PolarObservation('112', "station")) o112_111otra = PolarObservation("111", None, Angle("227-16-34", "DMS")) o112_113otra = PolarObservation("113", None, Angle("69-16-28", "DMS"), None, Distance(253.25, "HD")) s113otra = Station(None, PolarObservation('113', "station")) o113_112otra = PolarObservation("112", None, Angle("102-56-44", "DMS")) o113_114otra = PolarObservation("114", None, Angle("205-46-21", "DMS"), None, Distance(214.53, "HD")) s114otra = Station(None, PolarObservation('114', "station")) o114_113otra = PolarObservation("113", None, Angle("104-23-11", "DMS")) o114_115otra = PolarObservation("115", None, Angle("305-54-29", "DMS"), None, Distance(234.23, "HD")) s115otra = Station(None, PolarObservation("115", 'station')) plist = Calculation.traverse([[s5247otra, None, o5247_111otra], [s111otra, o111_5247otra, o111_112otra], [s112otra, o112_111otra, o112_113otra], [s113otra, o113_112otra, o113_114otra], [s114otra, o114_113otra, o114_115otra], [s115otra, None, None]]) assert compare(plist[0], Point('111', 646394.9860, 212353.8491)) assert compare(plist[1], Point('112', 646302.1362, 212245.3429)) assert compare(plist[2], Point('113', 646077.3941, 212128.60997)) assert compare(plist[3], Point('114', 646131.5459, 211921.02697)) assert compare(plist[4], Point('115', 646103.4028, 211688.4938))
def test_traverse4(): # loop traverse pA5tra = Point("A5", 646333.5695, 276616.4171) pA4tra = Point("A4", 646284.6886, 276659.2165) oA5tra = PolarObservation('A5', "station") sA5tra = Station(pA5tra, oA5tra) oA5_A4tra = PolarObservation("A4", None, Angle("311-12-21", "DMS")) oA5_A6tra = PolarObservation("A6", None, Angle("136-36-49", "DMS"), Angle("100-13-22", "DMS"), Distance(58.405, "SD")) # oA5_A11tra = PolarObservation("A11", None, Angle("146-26-58", "DMS"), Angle("90-00-00", "DMS"), # Distance(306.234, "SD")) sA5tra.o.hz = Calculation.orientation(sA5tra, [[pA4tra, oA5_A4tra]])[0] assert compare(sA5tra.o.hz.get_angle('DMS'), '359-59-57') sA6tra = Station(None, PolarObservation('A6', "station")) oA6_A5tra = PolarObservation("A5", None, Angle("316-36-49", "DMS"), Angle("79-56-53", "DMS"), Distance(58.378, "SD")) oA6_A7tra = PolarObservation("A7", None, Angle("136-43-52", "DMS"), Angle("101-55-08", "DMS"), Distance(43.917, "SD")) sA7tra = Station(None, PolarObservation('A7', "station")) oA7_A6tra = PolarObservation("A6", None, Angle("316-43-52", "DMS"), Angle("78-21-53", "DMS"), Distance(43.878, "SD")) oA7_A8tra = PolarObservation("A8", None, Angle("141-48-30", "DMS"), Angle("102-29-18", "DMS"), Distance(48.459, "SD")) sA8tra = Station(None, PolarObservation('A8', "station")) oA8_A7tra = PolarObservation("A7", None, Angle("321-48-30", "DMS"), Angle("77-49-44", "DMS"), Distance(48.401, "SD")) oA8_A9tra = PolarObservation("A9", None, Angle("153-25-18", "DMS"), Angle("100-01-16", "DMS"), Distance(47.098, "SD")) sA9tra = Station(None, PolarObservation('A9', "station")) oA9_A8tra = PolarObservation("A8", None, Angle("333-25-18", "DMS"), Angle("80-17-11", "DMS"), Distance(47.040, "SD")) oA9_A10tra = PolarObservation("A10", None, Angle("153-59-32", "DMS"), Angle("97-46-19", "DMS"), Distance(58.077, "SD")) sA10tra = Station(None, PolarObservation('A10', "station")) oA10_A9tra = PolarObservation("A9", None, Angle("333-59-32", "DMS"), Angle("82-27-53", "DMS"), Distance(58.045, "SD")) oA10_A11tra = PolarObservation("A11", None, Angle("154-05-41", "DMS"), Angle("97-06-32", "DMS"), Distance(58.188, "SD")) sA11tra = Station(None, PolarObservation('A11', "station")) oA11_A10tra = PolarObservation("A10", None, Angle("334-05-41", "DMS"), Angle("83-09-29", "DMS"), Distance(58.151, "SD")) # oA11_A5tra = PolarObservation("A5", None, Angle("326-26-13", "DMS"), Angle("90-00-00", "DMS"), # Distance(306.233, "SD")) plist = Calculation.traverse( [[sA5tra, None, oA5_A6tra], [sA6tra, oA6_A5tra, oA6_A7tra], [sA7tra, oA7_A6tra, oA7_A8tra], [sA8tra, oA8_A7tra, oA8_A9tra], [sA9tra, oA9_A8tra, oA9_A10tra], [sA10tra, oA10_A9tra, oA10_A11tra], [sA11tra, oA11_A10tra, None]]) assert compare(plist[0], Point('A6', 646373.0539, 276574.6449)) assert compare(plist[1], Point('A7', 646402.5093, 276543.3546)) assert compare(plist[2], Point('A8', 646431.7631, 276506.1698)) assert compare(plist[3], Point('A9', 646452.5118, 276464.6981)) assert compare(plist[4], Point('A10', 646477.7451, 276412.9820)) assert compare(plist[5], Point('A11', 646502.9712, 276361.0454))