Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am looking for a Python script that does the following:

  1. Uses a point (from a point shapefile) as the origin.
  2. Creates about 3 km line from point
  3. Based on an azimuth provided in the original point shapefile.
  4. Creates new entry in another shapefile with the new line

I imagine this involves trig, but I can't decide the best way to go about it.

share|improve this question

1 Answer 1

up vote 9 down vote accepted

You may not have to get too sophisticated--ArcGIS 10 has a tool to do just what you describe called Bearing Distance to Line (Data Management). You can even input a point shapefile as long as it has the attributes you need (i.e. X field, Y field, Distance Field, and Bearing). Of course you can add this tool to an arcpy script using:

arcpy.BearingDistanceToLine_management(in_table, out_featureclass, 
     x_field, y_field, distance_field, {distance_units}, bearing_field, 
     {bearing_units}, {line_type}, {id_field}, {spatial_reference})

enter image description here

share|improve this answer
That works! Thanks! –  Spatial Pariah Dec 12 '12 at 0:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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