civpy.survey.Alignment¶
-
class
civpy.survey.
Alignment
(name, pis=[], stakes=[], grid=10, view_offset=15, view_margin=15)[source]¶ A class representing a survey alignment.
Parameters: - name : str
Name of alignment.
- pis : list
A list of
PI
.- stakes : list
A list of
SurveyStake
.- grid : float
The grid size used for spatial hash generation.
- view_offset : float
The offset beyond which points will be ignored when generating station coordinates from global coordinates.
- view_margin : float
The station margin at the beginning and end of the alignment. Beyond this threshold, generated station coordinates from global coordinates will be ignored.
Examples
# alignment_ex1.py from civpy.survey import PI, Alignment, SurveyStake # PI coordinates p = [ # x, y z, r (-100, -200, 0, 0), (-200, -200, 0, 40), (-200, 200, 0, 40), ( 200, 200, 0, 40), ( 200, -200, 0, 40), ( 100, -200, 0, 40), ( 100, 100, 0, 40), (-100, 100, 0, 40), (-100, -100, 0, 40), ( 0, -100, 0, 40), ( 0, 0, 0, 0) ] # Stake survey stations q = [ # sta, off, z, ht, rot, ( 0, 30, 0, 0, -0.78539), ( 100, 30, 0, 0, 0), ( 300, -30, 0, 0, 0), ( 475, -30, 0, 0, 0), (1000, 0, 0, 0, 0), (1975, -30, 0, 0, 0) ] p = [PI(*x) for x in p] q = [SurveyStake.init_station(*x) for x in q] align = Alignment('Alignment', pis=p, stakes=q) align.plot_plan()
(Source code, png, hires.png, pdf)
Methods
azimuths
(self)Returns an array of alignment azimuths in the shape (N,). chord_distances
(self)Returns an array of chord distances corresponding to each PI in teh shape (N,). coordinates
(self, sta_coords)Returns the (x, y) or (x, y, z) global coordinates corresponding to the input station coordinates. curve_lengths
(self)Returns an array of horizontal curve lengths corresponding to each PI in teh shape (N,). deflection_angles
(self)Returns an array of PI deflection angles in the shape (N,). external_ordinates
(self)Returns an array of external ordinates corresponding to each PI in the shape (N,). middle_ordinates
(self)Returns an array of middle ordinate distances corresponding to each PI in the shape (N,). mpc_coordinates
(self)Returns an array of (x, y) coordinates for the Midpoint of Curves (MPC) in the shape (N, 2). mpc_stations
(self)Returns an array of stations for the Midpoint of Curves (MPC) in the shape (N,). pc_coordinates
(self)Returns an array of (x, y) coordinates for the Point of Curves (PC) in the shape (N, 2). pc_stations
(self)Returns an array of stations for the Point of Curves (PC) in the shape (N,). pi_coordinates
(self)Returns an array of PI coordinates of shape (N, 3). pi_radii
(self)Returns an array of PI horizontal curve radii of shape (N,). plot_plan
(self[, ax, step, symbols])Plots a the plan view for the alignment. poc_transforms
(self)Returns the POC transforms in the shape (N, 2, 2). pot_transforms
(self)Returns the POT transforms in the shape (N, 2, 2). pt_coordinates
(self)Returns an array of (x, y) coordinates for the Point of Tangents (PT) in the shape (N, 2). pt_stations
(self)Returns an array of (x, y) coordinates for the Point of Tangents (PT) in the shape (N, 2). rp_coordinates
(self)Returns an array of (x, y) coordinates for the Radius Points (RP) in the shape (N, 2). segment_indices
(self, stations)Determines the segment type and PI indices corresponding to the specified stations. set_stake_xy
(self)Sets the xy coordinates for all station stakes assigned to the alignment. station_coordinates
(self, coordinates)Finds the (station, offset) or (station, offset, z) coordinates for the input global coordinates. tangent_ordinates
(self)Returns an array of tangent ordinates corresponding to each PI in the shape (N,).