English

How To: Create connection lines between a point and a line

Summary

Instructions provided describe how to create 'connection lines' between a point feature class and a line feature class. This may be useful in situations where the distance from the line to a point is needed, or to illustrate a connection from a line to the nearest point.

Procedure

  1. Add the line and point feature classes to a blank map document.
  2. Export a copy of the original point feature class.

    a. Right-click the original points feature in the Table of Contents and select Data > Export Data.
    b. Browse to a good output location and give it an appropriate name, such as 'Append_Points', and click Save.
    c. Click OK to export the data.
    d. Click Yes when prompted to add the exported data to the map as a layer.

    Note:
    To make it less confusing, the the original point feature class can be removed from the map.

  3. Open the attribute table for the point layer and add a new field. Name it something such as 'ConnectionNum'.

    • The field type can be a simple Short Integer with all the defaults.

  4. Right-click the new 'ConnectionNum' field name and open the Field Calculator.
  5. Double-click the ObjectID value and run the calculation to populate this new field with the ObjectID.

    • This serves as the value used to connect the original point to the point that falls on the line, created in the subsequent steps.

  6. Open the Near tool from the toolbox (Analysis Tools > Proximity > Near).

    Note:
    The Near tool is only available at the Advanced license level.

    a. Input Features is the point layer.
    b. Near Features is the line layer
    c. Specify the Search Radius (optional).
    d. Check the Location box.
    e. Check the Angle box.
    f. Click OK to run the tool.
    [O-Image]
    This populates the point feature class table with five additional fields:

    • Near_FID
    • Near_Dist
    • Near_X
    • Near_Y
    • Near_Angle

  7. Open the Make XY Event Layer tool from the toolbox (Data Management Tools > Layers and Table Views > Make XY Event Layer).

    a. XY Table is the point feature class
    b. X Field is Near_X
    c. Y Field is Near_Y
    d. Specify Z Field (Optional)
    e. Specify the output Layer Name or Table View, for example: 'Line_Points_Layer'.
    f. Specify a Spatial Reference (optional).
    g. Click OK to run the tool.
    [O-Image]
    • This generates a new layer in the Table of Contents that displays the points calculated by the Near tool (the points that fall on the line).
  8. Open the Feature Class to Feature Class tool from the toolbox (Conversion Tools > To Geodatabase > Feature Class to Feature Class) to export the Line_Points_Layer XY Event layer to a feature class.

    a. Input Feature: Line_Points_Layer (layer made from Step 7, above)
    b. Output Location: The location in which the output feature class is to be created.
    c. Output Feature Class: The name of the output feature class, such as Line_Points.
    d. Specify the Expression (optional).
    e. Specify any Field Map (optional).
    f. Click OK to run the tool.
    [O-Image]
  9. Open the Append tool (Data Management Tools > General > Append).

    a. Input Datasets is Line_Points_Layer (feature class from Step 7, above).
    b. Target Dataset is the Append_Points feature class (feature class from Step 2 above).
    c. Set the Schema Type to No_Test (optional), meaning the input dataset schema (field definitions) do not have to match that of the target dataset.
    d. Leave the Field Map as the default (optional); this controls how the attribute information in input datasets' fields is transferred to the target dataset.
    e. Specify the Subtype (optional).
    f. Click OK to run the tool.
    [O-Image]
    • This appends both the original points and the points that fall on the line into one feature class.
  10. Open the Points to Line tool (Data Management Tools > Features > Points to Line).

    a. Input Features is the Append_Points (from Step 9, above).
    b. Specify a good Output Feature Class location and give it an appropriate name such as 'Connection_Lines'.
    c. Line Field is the ConnectionNum field.
    d. Specify the Sort Field (optional).
    e. Click OK to run the tool.
    [O-Image]
    • This process creates the connection lines between the point and the line feature classes. The extra layers that were created throughout the steps can be removed from the map.

Related Information