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.


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

|improve this answer|||||

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.