2

I have a feature class with thousands of points. In the same table with these point locations, I have two additional fields. One for azimuth, and one for a length (or distance) to move along that azimuth in order to create a new point location. I am looking for guidance on a python script that would accomplish this task?

table example 
x             y          length_fornew_point       azimuth 
400460.99 135836.76       5150.04                    55.41 
.... ....

Ultimately the script would run through my table, look at the existing coordinates and create a new end point at corresponding specified distance/azimuth in the table.

These two coordinates would then be used to create a new two point polyline.

  • Do you have access to the arcpy site-package? – Aaron Apr 10 '14 at 22:02
  • Hmmmm. How would I determine that? I'm using ArcGis 10.2 if that helps. Sorry. – user29061 Apr 10 '14 at 22:04
5

ArcGIS has a tool to do just that called Bearing Distance To Line (Data Management).

enter image description here


The syntax is as follows (from ESRI help):

# Import system modules
import arcpy
from arcpy import env

# Local variables
input_table = r"c:\workspace\LOBtraffic.dbf"
output_fc = r"c:\workspace\SOPA.gdb\lob_traf001"

#BearingDistanceToLine
arcpy.BearingDistanceToLine_management(input_table, output_fc, "X", "Y", 
"NAUTICAL_MILES", "azim", "DEGREES", "GEODESIC","recnum")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.