Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 12 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

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.