# Creating a Point at a specific distance between two Points

I am trying to create a new point shapefile and I am unsure how to create it. I want to create a new series of points that would be based on a specific distance between two points in an existing point data set.

I have already created an attribute table with two target points that the new point should be in-between and a specified distance that the new point should be away from one of the points towards the direction of the other point.

For example, New point A should be between existing point 1 and point 2, 60m from point 1 towards point 2 New point B should be between existing point 2 and point 3, 80m from point 2 towards point 3 New point C should be between existing point 3 and point 4, 106m from point 3 towards point 4 etc.

I am sure there are tools that can do this in ARC, but I am unsure what to use or how to get started.

• This is basic trigonometry. What have you tried? – Vince Feb 15 '17 at 19:40

i would use a spreadsheet to do the calculations and export the relevant information to csv. May be you can do something similar like this:

• You'll need two columns with X and Y for yout point coordinates (example: 4 rows)
• You'll need your distances from second point on, call it d' (3 rows)
• Calc dx and dy as absolute values of X2-X1 and Y2-Y1 (3 rows)
• Calc dt between 2 Points as sqrt(dx^2+dy2) (3 rows)
• Calc DX' as dx*d'/dt
• Calc DY' as dy*d'/dt
• Calc the "between point" x'/y' as
• x' = x0 + DX'
• y' = y0 + DY'
• Copy values only to new sheet and export it to csv

I tried this in excel, it looked ok...

• Nice answer, a lot of people overlook excel for simple things like this. Much better than any method that requires an edit session in ArcMap – DMusketeer Feb 21 '17 at 15:06
• true, and it gives more flexibility to test calculations. For me, working a lot with trial and error, i dont want to wait for writing files and displaying them in gis. The overhead of a python script could be developed later... – Andreas Müller Feb 21 '17 at 15:13

A more automated way...original point file with each point named and the name of the point to add the point between. Also distance for the new point to be made from the first point towards the second

Create an empty Point feature class with a text field for To and From

The following script is commented as to what is occurring.

``````import arcpy, math

# set your workspace where the files reside
arcpy.env.workspace = r"C:\Users\******\Documents\ArcGIS\Default.gdb"
# original points with distance value
input_fc = "points_original"
# new points created based on distnace and bearing
output_fc = "new_points"

# use a python dictionary to store to and from points names
to_from_dict = {}
with arcpy.da.SearchCursor(input_fc, ["NAME", "To"]) as cursor:
for row in cursor:
to_from_dict[row[0]] = row[1]

# add a field to store the angle (bearing)

# for each from/to coupling
tmp_count = 0
for key, value in to_from_dict.iteritems():
# create a temp selection of the from point
from_pt = "lyr_from_" + str(tmp_count)
arcpy.MakeFeatureLayer_management(input_fc, from_pt, "NAME = '" + str(key) + "'")
#temp selection of the to point
to_pt = "lyr_to_" + str(tmp_count)
arcpy.MakeFeatureLayer_management(input_fc, to_pt, "NAME = '" + str(value) + "'")
# use near geoprocessing tool to get the angle
arcpy.Near_analysis(from_pt, to_pt, "", "", "ANGLE")
# add the angle for the from point
arcpy.CalculateField_management(from_pt, "Angle", "!NEAR_ANGLE!", "PYTHON_9.3")
tmp_count += 1

# delete unnecessary fields
arcpy.DeleteField_management(input_fc, "NEAR_FID")
arcpy.DeleteField_management(input_fc, "NEAR_DIST")
arcpy.DeleteField_management(input_fc, "NEAR_ANGLE")

## the following is based on a workflow from

# for each row in the original point fc
with arcpy.da.SearchCursor(input_fc, ["SHAPE@XY", "Angle", "Distance", "Name", "To"]) as cursor:
for row in cursor:
in_x = row[0][0]
in_y = row[0][1]
bearing = row[1]
distance = row[2]

# create new x and y coordinates for new point
out_x = in_x + distance * math.cos(bearing)
out_y = in_y + distance * math.sin(bearing)

point = arcpy.Point(out_x, out_y)

# add the new point to the empty fc along with some attributes
# not ArcGIS made me name the field From_ (and not From)
with arcpy.da.InsertCursor(output_fc, ["SHAPE@XY", "To", "From_"]) as cursor:
new_record = [point, row[3], row[4]]
cursor.insertRow(new_record)
``````

The new points are in red below and the specified distance from the first point towards the second point

• Well done! How fast is it? I often feel bored waiting arcgis tools to complete their work... – Andreas Müller Feb 21 '17 at 15:17
• 20 seconds for those 12 points. – Clubdebambos Feb 21 '17 at 15:22

A manual option... you have a feature class with two points

Use Near geoprocessing tool with point fc as Input and as Near Features, check on Angle. (Location optional)

Start editing the point fc. On the Editor toolbar select Direction-Distance

Turn on point snapping

Select a point and move the cursor away from the point, a line will appear. Hit D on the keyboard and enter the corresponding angle from your attribute table. In my example I have selected point A and used the angle 48.227657 towards point B.

Click Enter. Click on the same point again. Move away from point A towards point B and hit D on the keyboard. Enter your distance. I have selected 60m.

Hit ENTER, click on the intersection of the circle and line to define the point. It will be added to the fc and a record added to the attribute table.

A new point has been created between point A and B at a specified distance

• While this works, I would seriously encourage anyone not to do it this way. it's laborious and invites user error. Your more automated solution is great. – DMusketeer Feb 21 '17 at 15:01

It sounds like you could solve this with a python script.

You want to create a point that is the midpoint between two existing points, so what you would do is take the average of the x values and the average of the y values and use those as the location of your new point.

• A midpoint is not being requested. This is a simplification of the original problem, but you could develop this into a correct answer by prorating the point along the slope at the required distance. – Vince Feb 15 '17 at 21:57
• Something like this? i.imgur.com/Gwk4itE.png – jm_gis Feb 15 '17 at 22:20