Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I work in ArcGIS. I want create a network with a point feature and a line feature. And I need that my point feature being on the lines feature. So I should do Snap point to line. But do not know how do it in ArcGIS, and then automate it with code for this in VBA. Please help me, thanks.

share|improve this question
    
Did you try the Editor snapping environment? –  Jakub Aug 23 '10 at 16:20
    
"and then automate it with write code for this in VBA" –  Simon Aug 24 '10 at 6:08
    
if points do not hold the critical information. you can also tr transform your line into points –  nadeem fareed Aug 27 '13 at 15:16
add comment

5 Answers

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.
share|improve this answer
    
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 Feb 27 '12 at 19:04
    
It is worth mentioning that this solution works for users that have an ArcInfo (advanced) license. –  Hornbydd Aug 8 '13 at 17:40
add comment

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:

share|improve this answer
add comment

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.

share|improve this answer
add comment

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.

share|improve this answer
    
I have it,but it can not work with ArcGIS 9.3. –  Nima Aug 23 '10 at 6:42
    
I deleted your second answer and merged it into this one. –  fmark Aug 24 '10 at 2:29
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.