Calculate line of sight


Purpose
This sample demonstrates how to use the line of sight (LOS) geoprocessing tool. It assumes two points for the observer and target, and it calculates whether the two points are visible. It also calculates the visibility of surface features along the path between the two points.
 
The line defining the two points can be two-dimensional (2D) or three-dimensional (3D) (z-aware). In a 3D line, using the LOS tool, the target and observer are at a height above sea level equal to the z-value. In a 2D line, the target and observer are on the surface with an offset of 1 (one) for the observer. By setting values for the offsetA and offsetB fields, the target and observer can be raised off the surface or above their z-value.
 
To complete this analysis, two polyline feature classes are created using CreateFeatureClass and AddField. The files are then edited using Workspaces and FeatureClass.createFeature().

How to use

See How to use ArcGIS samples for help on running the sample.

  1. Run the CalculateLineOfSight application.
  2. After the execution is complete, examine output messages on the console, as well as the output dataset.

If you installed the samples feature, you will find the files associated with this sample in <Your Developer Kit install location>\DeveloperKit10.4\Java\Samples\ArcObjects.

geoprocessing/CalculateLineOfSight.java Main class.




Development licensing Deployment licensing
Engine Developer Kit Engine
ArcGIS for Desktop Basic