Bearing Distance To Line (Data Management)

Summary

Creates a feature class containing geodetic or planar line features from the values in an x-coordinate field, y-coordinate field, bearing field, and distance field of a table.

Illustration

Bearing Distance To Line tool illustration
Bearing and distance construction parameters are shown.

Usage

  • Output lines are constructed from field values. The field values include the following:

    • The x- and y-coordinates of a starting point
    • The distance from the starting point
    • The bearing angle
    The fields and their values will be included in the output.

  • When the output lines are geodetic, the x- and y- coordinates and distance are measured on the surface of the earth, and the bearing angle is measured from north. When the output lines are planar, the x- and y- coordinates and distance are measured on the projected plane, and the bearing angle is measured clockwise from grid north (vertical up on the map).

  • A geodetic line is a curve on the surface of the earth. However, a geodetic line feature is not stored as a parametric (true) curve in the output; rather, it is stored as a densified polyline representing the path of the geodetic line. If the length of a geodetic line is relatively short, it may be represented by a straight line in the output. As the length of the line increases, more vertices are used to represent the path.

  • When the output is a feature class in a geodatabase, the values in the Shape_Length field are always in the units of the output coordinate system specified by the Spatial Reference parameter, and they are the planar lengths of the polylines. To measure a geodesic length or distance, use the ArcGIS Pro Measure tool and choose the Geodesic, Loxodrome, or Great Elliptic option accordingly before taking a measurement.

Parameters

LabelExplanationData Type
Input Table

The input table. It can be a text file, CSV file, Excel file, dBASE table, or geodatabase table.

Table View
Output Feature Class

The output feature class containing geodetic or planar lines.

Feature Class
X Field

A numerical field in the input table containing the x-coordinates (or longitudes) of the starting points of lines to be positioned in the output coordinate system specified by the Spatial Reference parameter.

Field
Y Field

A numerical field in the input table containing the y-coordinates (or latitudes) of the starting points of lines to be positioned in the output coordinate system specified by the Spatial Reference parameter.

Field
Distance Field

A numerical field in the input table containing the distances from the starting points for creating the output lines.

Field
Distance Units
(Optional)

Specifies the units that will be used for the Distance Field parameter.

  • MetersThe units will be meters.
  • KilometersThe units will be kilometers.
  • MilesThe units will be miles.
  • Nautical milesThe units will be nautical miles.
  • FeetThe units will be feet.
  • U.S. survey feetThe units will be U.S. survey feet.
String
Bearing Field

A numerical field in the input table containing bearing angle values for the output line rotation. The angles are measured clockwise from north.

Field
Bearing Units
(Optional)

Specifies the units of the Bearing Field parameter values.

  • Decimal degrees The units will be decimal degrees. This is the default.
  • MilsThe units will be mils.
  • RadiansThe units will be radians.
  • GradiansThe units will be gradians.
String
Line Type
(Optional)

Specifies the type of line that will be constructed.

  • Geodesic A type of geodetic line that most accurately represents the shortest distance between any two points on the surface of the earth will be constructed. This is the default.
  • Great circleA type of geodetic line that represents the path between any two points along the intersection of the surface of the earth and a plane that passes through the center of the earth will be constructed. If the Spatial Reference parameter value is a spheroid-based coordinate system, the line is a great elliptic. If the Spatial Reference parameter value is a sphere-based coordinate system, the line is uniquely called a great circle—a circle of the largest radius on the spherical surface.
  • Rhumb lineA type of geodetic line, also known as a loxodrome line, that represents a path between any two points on the surface of a spheroid defined by a constant azimuth from a pole will be constructed. A rhumb line is shown as a straight line in the Mercator projection.
  • Normal sectionA type of geodetic line that represents a path between any two points on the surface of a spheroid defined by the intersection of the spheroid surface and a plane that passes through the two points and is normal (perpendicular) to the spheroid surface at the starting point of the two points will be constructed. The normal section line from point A to point B is different from the line from point B to point A.
  • Planar lineA straight line in the projected plane will be used. A planar line usually does not accurately represent the shortest distance on the surface of the earth as a geodesic line does. This option is not available for geographic coordinate systems.
String
ID
(Optional)

A field in the input table. This field and the values are included in the output and can be used to join the output features with the records in the input table.

Field
Spatial Reference
(Optional)

The spatial reference of the output feature class. The default is GCS_WGS_1984 or the input coordinate system if it is not Unknown.

Spatial Reference
Preserve attributes
(Optional)

Specifies whether the remaining input fields will be added to the output feature class.

  • Unchecked—The remaining input fields will not be added to the output feature class. This is the default.
  • Checked—The remaining input fields will be added to the output feature class. A new field, ORIG_FID, will also be added to the output feature class to store the input feature ID values.

Boolean

arcpy.management.BearingDistanceToLine(in_table, out_featureclass, x_field, y_field, distance_field, {distance_units}, bearing_field, {bearing_units}, {line_type}, {id_field}, {spatial_reference}, {attributes})
NameExplanationData Type
in_table

The input table. It can be a text file, CSV file, Excel file, dBASE table, or geodatabase table.

Table View
out_featureclass

The output feature class containing geodetic or planar lines.

Feature Class
x_field

A numerical field in the input table containing the x-coordinates (or longitudes) of the starting points of lines to be positioned in the output coordinate system specified by the spatial_reference parameter.

Field
y_field

A numerical field in the input table containing the y-coordinates (or latitudes) of the starting points of lines to be positioned in the output coordinate system specified by the spatial_reference parameter.

Field
distance_field

A numerical field in the input table containing the distances from the starting points for creating the output lines.

Field
distance_units
(Optional)

Specifies the units that will be used for the distance_field parameter.

  • METERSThe units will be meters.
  • KILOMETERSThe units will be kilometers.
  • MILESThe units will be miles.
  • NAUTICAL_MILESThe units will be nautical miles.
  • FEETThe units will be feet.
  • US_SURVEY_FEETThe units will be U.S. survey feet.
String
bearing_field

A numerical field in the input table containing bearing angle values for the output line rotation. The angles are measured clockwise from north.

Field
bearing_units
(Optional)

Specifies the units of the bearing_field parameter values.

  • DEGREES The units will be decimal degrees. This is the default.
  • MILSThe units will be mils.
  • RADSThe units will be radians.
  • GRADSThe units will be gradians.
String
line_type
(Optional)

Specifies the type of line that will be constructed.

  • GEODESIC A type of geodetic line that most accurately represents the shortest distance between any two points on the surface of the earth will be constructed. This is the default.
  • GREAT_CIRCLEA type of geodetic line that represents the path between any two points along the intersection of the surface of the earth and a plane that passes through the center of the earth will be constructed. If the Spatial Reference parameter value is a spheroid-based coordinate system, the line is a great elliptic. If the Spatial Reference parameter value is a sphere-based coordinate system, the line is uniquely called a great circle—a circle of the largest radius on the spherical surface.
  • RHUMB_LINEA type of geodetic line, also known as a loxodrome line, that represents a path between any two points on the surface of a spheroid defined by a constant azimuth from a pole will be constructed. A rhumb line is shown as a straight line in the Mercator projection.
  • NORMAL_SECTIONA type of geodetic line that represents a path between any two points on the surface of a spheroid defined by the intersection of the spheroid surface and a plane that passes through the two points and is normal (perpendicular) to the spheroid surface at the starting point of the two points will be constructed. The normal section line from point A to point B is different from the line from point B to point A.
  • PLANARA straight line in the projected plane will be used. A planar line usually does not accurately represent the shortest distance on the surface of the earth as a geodesic line does. This option is not available for geographic coordinate systems.
String
id_field
(Optional)

A field in the input table. This field and the values are included in the output and can be used to join the output features with the records in the input table.

Field
spatial_reference
(Optional)

The spatial reference of the output feature class. A spatial reference can be specified as any of the following:

  • The path to a .prj file, such as C:/workspace/watershed.prj
  • The path to a feature class or feature dataset whose spatial reference you want to apply, such as C:/workspace/myproject.gdb/landuse/grassland
  • A SpatialReference object, such as arcpy.SpatialReference("C:/data/Africa/Carthage.prj")

Spatial Reference
attributes
(Optional)

Specifies whether the remaining input fields will be added to the output feature class.

  • NO_ATTRIBUTESThe remaining input fields will not be added to the output feature class. This is the default.
  • ATTRIBUTESThe remaining input fields will be added to the output feature class. A new field, ORIG_FID, will also be added to the output feature class to store the input feature ID values.
Boolean

Code sample

BearingDistanceToLine example (stand-alone script)

Convert bearing and distance information into a line.

# Import system modules
import arcpy

# Local variables
input_table = r'c:\workspace\LOBtraffic.dbf'
output_fc = r'c:\workspace\SOPA.gdb\lob_traf001'

# BearingDistanceToLine
arcpy.BearingDistanceToLine_management(input_table, output_fc, 'X', 'Y', 
                                       'NAUTICAL_MILES', 'azim', 'DEGREES', 
                                       'GEODESIC', 'recnum')

Related topics