Coordinate Table To 2-Point Line (Defense)

Summary

Creates 2-point line features from coordinates stored in a table.

Usage

  • The output lines are created by connecting starting and ending point coordinate pairs.

  • Each starting and ending point coordinate pair will become a separate line feature in the output feature class.

Syntax

CoordinateTableTo2PointLine(in_table, out_feature_class, start_x_or_lon_field, end_x_or_lon_field, in_coordinate_format, {start_y_or_lat_field}, {end_y_or_lat_field}, {line_type}, {coordinate_system})
ParameterExplanationData Type
in_table

The table containing the source coordinates.

Table View
out_feature_class

The feature class containing the output line features.

Feature Class
start_x_or_lon_field

The field in the input table containing the starting x or longitude coordinates.

Field
end_x_or_lon_field

The field in the input table containing the ending x or longitude coordinates.

Field
in_coordinate_format

Specifies the format of the point coordinates.

  • DD_1Coordinates will be formatted in a decimal degrees coordinate pair stored in a single field with coordinates separated by a space, comma, or slash.
  • DD_2Coordinates will be formatted in a decimal degrees coordinate pair stored in two table fields. This is the default.
  • DDM_1Coordinates will be formatted in a degrees and decimal minutes coordinate pair stored in a single table field with coordinates separated by a space, comma, or slash.
  • DDM_2Coordinates will be formatted in a degrees and decimal minutes coordinate pair stored in two table fields.
  • DMS_1Coordinates will be formatted in a degrees, minutes, and seconds coordinate pair stored in a single table field with coordinates separated by a space, comma, or slash.
  • DMS_2Coordinates will be formatted in a degrees, minutes, and seconds coordinate pair stored in two table fields.
  • GARSCoordinates will be formatted in Global Area Reference System.
  • GEOREF Coordinates will be formatted in World Geographic Reference System.
  • UTM_BANDSCoordinates will be formatted in Universal Transverse Mercator coordinate bands.
  • UTM_ZONESCoordinates will be formatted in Universal Transverse Mercator coordinate zones.
  • USNGCoordinates will be formatted in United States National Grid.
  • MGRSCoordinates will be formatted in Military Grid Reference System.
String
start_y_or_lat_field
(Optional)

The field in the input table containing the starting y or latitude coordinates.

The start_y_or_lat_field parameter is used when the in_coordinate_format parameter is set to DD_2, DDM_2, orDMS_2.

Field
end_y_or_lat_field
(Optional)

The field in the input table containing the ending y or latitude coordinates.

The end_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.

  • GEODESICThe shortest distance between any two points on the earth's spheroidal surface (ellipsoid) will be used. This is the default.
  • GREAT_CIRCLEThe line on a spheroid (ellipsoid) defined by the intersection of a plane passing through the center of the spheroid will be used.
  • RHUMB_LINEA line of constant bearing or azimuth will be used.
  • NORMAL_SECTIONA normal plane to the earth's ellipsoidal surface containing the start and end points will be used.
String
coordinate_system
(Optional)

The spatial reference of the output feature class. The default is GCS_WGS_1984.

Spatial Reference

Code sample

CoordinateTableTo2PointLine example 1 (Python window)

The following Python window script demonstrates how to use the CoordinateTableTo2PointLine function.

import arcpy
arcpy.env.workspace = r"C:/Data.gdb"
arcpy.CoordinateTableTo2PointLine_defense(r"C:/CSV/Tableto2PointLine.csv", 
                                          "OutputLines", "POINT_X", "POINT_X2",
                                          "DD_2", "POINT_Y", "POINT_Y2")
CoordinateTableTo2PointLine example 2 (stand-alone script)

Create line features from a table and densify the lines.

# Description: Densify line features created from tabular data

# Import system modules
import arcpy

# Set environment settings
arcpy.env.workspace = "C:/Data.gdb"
arcpy.env.overwriteOutput = True

# Create lines
input_table = r"C:/CSV/TableTo2PointLine.csv"
result_line = "TableTo2Point"
arcpy.CoordinateTableTo2PointLine_defense(input_table, result_line, "POINT_X", 
                                          "POINT_X2", "DD_2", "POINT_Y", 
                                          "POINT_Y2")

# Densify lines
arcpy.Densify_edit(result_line, "DISTANCE", "2 Kilometers")

Environments

This tool does not use any geoprocessing environments.

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics