11

I use ArcGIS Desktop and I want create a network with a point feature and a line feature. I need my point features to be on the line features so I should do Snap point to line.

However, I do not know how do it in ArcGIS, and then automate it with code for this in VBA.

4
  • Did you try the Editor snapping environment? Commented Aug 23, 2010 at 16:20
  • "and then automate it with write code for this in VBA"
    – jakc
    Commented Aug 24, 2010 at 6:08
  • if points do not hold the critical information. you can also tr transform your line into points Commented Aug 27, 2013 at 15:16
  • You can refer this video to snap point features to a line feature using arcMap.. youtu.be/Lb-9ql_o4Sg Commented Jun 9, 2020 at 7:31

5 Answers 5

22

Snapping points to a line using ArcGIS geoprocessing tools

Assumptions:

You have a point layer and a line layer. You want a points to be snapped to the line layer.

Instructions

1. Use the Near tool to find snap locations

  1. In ArcGIS's Toolbox pane, Select Analysis Tools -> Proximity -> Near
  2. Choose your point layer as Input features, your line layer as Near features. Make sure you tick the Location checkbox.
  3. Four new attributes will be added to your point layer, NEAR_FID, NEAR_DIST, NEAR_X and NEAR_Y.

2. Export the layer as a table

  1. Open the attribute table of the point layer
  2. Click on the Table Options button in the attribute table window, and choose Export.... Save it is a dbase (.dbf) file.
  3. When prompted if you want to add the table to your current map, choose Yes.

3. Recreate the points layer from the table

  1. Find the table you just added in your Table of Contents pane. You might need to switch tabs if you are using ArcGIS 9.3 to the Source tab.
  2. Right-click on the table, and choose Add XY Data.
  3. Make sure the X field is set to NEAR_X, and the Y field to NEAR_Y. Adjust the coordinate system if appropriate.
  4. Your new point Event layer should appear in the table of contents. Right click on it, and select Data->Export data... to save the layer permanently as a shapefile.
2
  • Thanks for this answer. It is a clear method that I can immediately try. I am able to work with the results to get what I need.
    – cwb
    Commented Feb 27, 2012 at 19:04
  • It is worth mentioning that this solution works for users that have an ArcInfo (advanced) license.
    – Hornbydd
    Commented Aug 8, 2013 at 17:40
6

ArcGIS 9.3.x:

In the ArcGIS interface, use the snapping environment within the Editing toolbar.

Programmatically, you can find a number of snapping-based Visual Basic examples at the ESRI resources page (note: personally, I like to use the old page. I think it's easier to find stuff. VB resources). See for instance, VB code to "bulk snap": "The Bulk Snap command will take selected features and attempt to snap them based on the current settings of the Editor snap environment."

ArcGIS 10:

1

You can do it with Hawths Analysis Tool. You can download it here.

I found it here for ArcGis 9.3 but I warn you that I did not test it. If you have time you can try it.

2
  • I have it,but it can not work with ArcGIS 9.3.
    – Nima
    Commented Aug 23, 2010 at 6:42
  • I deleted your second answer and merged it into this one.
    – fmark
    Commented Aug 24, 2010 at 2:29
0

Assumption you have the Network Analysis Extension for ArcGIS (9.3) Sp3: Your 'Network'

Creating a Network >Arcatalog (you must understand the TYPE of network you are trying to build first!) http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Creating_a_network_dataset

You can automate this with ModelBuilder (Python)

http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Add_Locations_(Network_Analyst)

{linear unit}
The search tolerance for locating the input features on the network. The parameter includes a value and units for the tolerance.

{source {snap type};source {snap type}...} point and line Allows you to specify which sources in your network dataset will be searched when finding locations, as well as specifying what portions of geometry will be used.

0

There are plenty of tools available on Arcscripts. See this search

I cannot vouch for it, but Snap and split program looks like it fits your requirements?

Let me know if you have problems "installing" it or using it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.