Line Of Sight (3D Analyst)

Summary

Determines the visibility of sight lines over obstructions consisting of a surface and an optional multipatch dataset.

Learn more about how Line Of Sight works

Illustration

Line Of Sight tool illustration

Usage

  • Only the endpoints of the input line are used to define the observer and target. Sight lines should be straight lines composed of two vertices representing the observation point and the target location for which visibility is determined.

  • Consider creating sight lines with the Construct Sight Lines tool if the visibility targets reside in a different feature class. For example, sight lines can be generated by sampling a target line feature at a specific interval to test the visibility along a path.

  • Output lines will be divided along visible and invisible portions of the input sight line. If only a surface is used to determine sight line visibility, the output lines will follow the surface profile. If a multipatch feature is provided when calculating line of sight, the output lines will follow the trajectory of the input sight lines.

  • The output line feature's attribute table contains the following fields:

    • SourceOID—The unique ID of the line feature used in calculating visibility.
    • VisCode—The visibility along the line. A value of 1 indicates visible, and a value of 2 indicates not visible. This field will only exist if the output geometry is a line.
    • TarIsVis—The target visibility along the line. A value of 1 indicates visible, and a value of 0 indicates not visible. This field will only exist if the output geometry is a line.
    • OBSTR_MPID—The obstruction that blocks the visibility of the target point. A separate line feature will be created for the visible and obstructed portions of each input sight line. The portion that is not obstructed will have a value of -9999, the portion that is obstructed by a multipatch will have the unique ID of the obstructing feature, and the portion that is obstructed by the surface will have a value of -1.

Parameters

LabelExplanationData Type
Input Surface

The integrated mesh scene layer, LAS dataset, raster, TIN, or terrain surface used to determine visibility.

TIN Layer; Raster Layer; Mosaic Layer; Terrain Layer; LAS Dataset Layer; Scene Layer; File
Input Line Features

The sight line features whose first vertex defines the observation point and last vertex identifies the target location. When the sight lines are 2D features, the observer and target heights will be derived from the input surface. When the sight lines are 3D features, the observer and target heights will be obtained from the feature's z-coordinates.

2D lines will be evaluated at an offset from the underlying surface. A default offset of 1 is applied to raise the points above the surface. Use a field named OffsetA to define a custom offset height for the observer, use a field named OffsetB to define a custom offset for the target.

Feature Layer
Output Feature Class

The output line feature class along which visibility has been determined. Two attribute fields are created. The VisCode field indicates visibility along the line: 1 being visible and 2 not visible. The TarIsVis field indicates the target visibility: 0 being not visible and 1 being visible.

Feature Class
Output Obstruction Point Feature Class
(Optional)

An optional point feature class identifying the location of the first obstruction on the observer's sight line to its target.

Feature Class
Use Curvature
(Optional)

Specifies whether the earth's curvature will be taken into consideration for the line-of-sight analysis. For this parameter to be active, the surface must have a defined spatial reference in projected coordinates with defined z-units.

  • Unchecked—The earth's curvature will not be taken into consideration. This is the default.
  • Checked—The earth's curvature will be taken into consideration.
Boolean
Use Refraction
(Optional)

Specifies whether atmospheric refraction will be taken into consideration when generating a line of sight from a functional surface. This parameter does not apply if multipatch features are used.

  • Unchecked—Atmospheric refraction will not be taken into consideration. This is the default.
  • Checked—Atmospheric refraction will be taken into consideration.
Boolean
Refraction Factor
(Optional)

The value to be used in the refraction factor. The default value is 0.13.

Double
Pyramid Level Resolution
(Optional)

The z-tolerance or window-size resolution of the terrain pyramid level that will be used. The default value is 0, or full resolution.

Double
Input Features
(Optional)

A multipatch feature that may define additional obstructing elements, such as buildings. Refraction options are not honored for this input.

Feature Layer

arcpy.ddd.LineOfSight(in_surface, in_line_feature_class, out_los_feature_class, {out_obstruction_feature_class}, {use_curvature}, {use_refraction}, {refraction_factor}, {pyramid_level_resolution}, {in_features})
NameExplanationData Type
in_surface

The integrated mesh scene layer, LAS dataset, raster, TIN, or terrain surface used to determine visibility.

TIN Layer; Raster Layer; Mosaic Layer; Terrain Layer; LAS Dataset Layer; Scene Layer; File
in_line_feature_class

The sight line features whose first vertex defines the observation point and last vertex identifies the target location. When the sight lines are 2D features, the observer and target heights will be derived from the input surface. When the sight lines are 3D features, the observer and target heights will be obtained from the feature's z-coordinates.

2D lines will be evaluated at an offset from the underlying surface. A default offset of 1 is applied to raise the points above the surface. Use a field named OffsetA to define a custom offset height for the observer, use a field named OffsetB to define a custom offset for the target.

Feature Layer
out_los_feature_class

The output line feature class along which visibility has been determined. Two attribute fields are created. The VisCode field indicates visibility along the line: 1 being visible and 2 not visible. The TarIsVis field indicates the target visibility: 0 being not visible and 1 being visible.

Feature Class
out_obstruction_feature_class
(Optional)

An optional point feature class identifying the location of the first obstruction on the observer's sight line to its target.

Feature Class
use_curvature
(Optional)

Specifies whether the earth's curvature will be taken into consideration for the line-of-sight analysis. For this parameter to be enabled, the surface must have a defined spatial reference in projected coordinates with defined z-units.

  • CURVATUREThe earth's curvature will be taken into consideration.
  • NO_CURVATUREThe earth's curvature will not be taken into consideration. This is the default.
Boolean
use_refraction
(Optional)

Specifies whether atmospheric refraction will be taken into consideration when generating a line of sight from a functional surface. This parameter does not apply if multipatch features are used.

  • REFRACTIONAtmospheric refraction will be taken into consideration.
  • NO_REFRACTIONAtmospheric refraction will not be taken into consideration. This is the default.
Boolean
refraction_factor
(Optional)

The value to be used in the refraction factor. The default value is 0.13.

Double
pyramid_level_resolution
(Optional)

The z-tolerance or window-size resolution of the terrain pyramid level that will be used. The default value is 0, or full resolution.

Double
in_features
(Optional)

A multipatch feature that may define additional obstructing elements, such as buildings. Refraction options are not honored for this input.

Feature Layer

Code sample

LineOfSight example 1 (Python window)

The following sample demonstrates the use of this tool in the Python window.

arcpy.env.workspace = "C:/data"
arcpy.ddd.LineOfSight("tin", "line.shp", "los.shp", "buldings_multipatch.shp", 
                    "obstruction.shp")
LineOfSight example 2 (stand-alone script)

The following sample demonstrates the use of this tool in a stand-alone Python script.

'''*********************************************************************
Name: Sight Line Visibility of Parade Path
Description: This script demonstrates how to create a sight line feature class
             from a pair of observer and target points.
*********************************************************************'''
# Import system modules
import arcpy

# Set Local Variables:
arcpy.env.workspace = 'C:/data'

# Setting up input and output variables:
obs = "observer_pts.shp"
tar = "parade_path.shp"
sightlines = "output_sightlines.shp"
height = "<None>"
join_field = "#"
sampling = 0.5
direction = "OUTPUT_THE_DIRECTION"
surface = 'elevation.tif'
bldgs = 'buildings.shp'

arcpy.ddd.ConstructSightLines(obs, tar, sightlines, height, height,
                              join_field, sampling, direction)
arcpy.ddd.LineOfSight(surface, sightlines, "Parade_LOS.shp",
                      "Obstructions.shp", in_features=bldgs)

Licensing information

  • Basic: Requires 3D Analyst
  • Standard: Requires 3D Analyst
  • Advanced: Requires 3D Analyst

Related topics