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– Aaron ♦2014年04月10日 22:02:58 +00:00Commented Apr 10, 2014 at 22:02
-
Hmmmm. How would I determine that? I'm using ArcGis 10.2 if that helps. Sorry.user29061– user290612014年04月10日 22:04:35 +00:00Commented Apr 10, 2014 at 22:04
1 Answer 1
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")
Explore related questions
See similar questions with these tags.