Summary
Creates lines of bearing from coordinates stored in a table.
Usage
The output line feature class will have fields for both bearing and distance values.
Syntax
CoordinateTableToLineOfBearing(in_table, out_feature_class, x_or_lon_field, bearing_field, distance_field, in_coordinate_format, {bearing_units}, {distance_units}, {y_or_lat_field}, {line_type}, {coordinate_system})
Parameter | Explanation | Data Type |
in_table | The table containing the source coordinates. | Table View |
out_feature_class | The feature class containing the output lines of bearing. | Feature Class |
x_or_lon_field | The field in the input table containing the x or longitude coordinates. | Field |
bearing_field | The field in the input table containing the bearing values. | Field |
distance_field | The field in the input table containing the distance values. | Field |
in_coordinate_format | Specifies the format of the input table coordinates.
| String |
bearing_units (Optional) | Specifies the unit of measurement for the bearing angles.
| String |
distance_units (Optional) | Specifies the units of measurement for the distance.
| String |
y_or_lat_field (Optional) | The field in the input table containing the y or latitude coordinates. The y_or_lat_field parameter is used when the in_coordinate_format parameter is set to DD_2, DDM_2, or DMS_2. | Field |
line_type (Optional) | Specifies the output line type.
| String |
coordinate_system (Optional) | The spatial reference of the output feature class. The default is GCS_WGS_1984. | Spatial Reference |
Code sample
The following Python window script demonstrates how to use the CoordinateTableToLineOfBearing function.
import arcpy
arcpy.env.workspace = r"C:/Data.gdb"
arcpy.CoordinateTableToLineOfBearing_defense(r"C:CSV/TableToLineOfBearing.csv",
"LOB",
"x",
"Orientation",
"Distance",
"DD_2",
"DEGREES",
"KILOMETERS",
"y")
The following example uses the CoordinateTableToLineOfBearing function in an example workflow script.
# Description: Create lines of bearing from tabular data and then create
# bounding envelopes around each line.
# Import system modules
import arcpy
# Set environment settings
arcpy.env.workspace = r"C:/Data.gdb"
arcpy.env.overwriteOutput = True
# Create lines of bearing
input_table = r"C:/CSV/TableToLineOfBearing.csv"
result_line = "Output_LOB"
arcpy.CoordinateTableToLineOfBearing_defense(input_table,
result_line,
"x",
"Orientation",
"Distance",
"DD_2",
"DEGREES",
"KILOMETERS",
"y")
# Create envelopes
result_envelope = "Output_Envelope"
arcpy.FeatureEnvelopeToPolygon_management(result_line, result_envelope)
Environments
Licensing information
- Basic: Yes
- Standard: Yes
- Advanced: Yes