# Moving points closer to polyline using ModelBuilder?

I have a lot of points I need to move that are on the edge of the parcels closer to the centerline(road), not directly on top but about 5 feet away from the centerline.

I know i can edit and move the points manually but is there a way to automate the process using ModelBuilder?

• Do you have advance license level? – BERA Jun 6 '19 at 18:44
• yes i do have advance license level – C77 Jun 6 '19 at 22:37

You'll need a Standard or higher license for this method. Create a buffer feature class from your centerlines with a 5 foot buffer distance. Then use the Snap tool. Your points are your input features. Your centerline buffers are your snap features. Use `Edge` as your type.

Slight variation of 2 other solutions. Use Near tool (location) on your points and buffer. Calculate Shape field using calculator (Python):

``````arcpy.Point( !NEAR_X!, !NEAR_Y!)
``````

Note: this will modify original shapes, so create a copy first. Difference with Snap tool - you don't need to guess distance, and generate near table looks like unnecessary complication.

You can use "generate near table" and then recalculate the geometry to move them.

test this on a copy of your data as I'm typing this process from memory right now

With Generate Near Table: "input feature" is your points. "Near feature" is a 5 foot buffer of your lines (alternatively you could use copy parallel to create new lines that are 5 feet on either side of the street centerlines and use those here)

check on the boxes for "location" and "Find only closest"

the output is a table of:

``````Input Point ObjectIDs (IN_FID)
Near line Object ID (NEAR_FID)
How far away that line is (NEAR_DIST)
The current X and Y of your points (FROM_X and FROM_Y)
The nearest coordinate on the lines you want to move to (NEAR_X and NEAR_Y)
``````

Join this table to your points and then you can move them by recalculating the (SHAPE*) field in your points table with this in the field calculator:

specify the parser as Python click the box for "show Codebook" put this in the Pre-Logic box:

``````def movePoint(shape, xCoord, yCoord):
point = shape.getPart(0)
point.X = xCoord
point.Y = yCoord
return point
``````

then in the box below that, enter

mypoints.SHAPE =

``````movePoint( !SHAPE!, !neartable.NEAR_X! , !neartable.NEAR_Y! )
``````

refresh the view and teh points should hopefully have moved to the new XY positions