I have a multiple multipart contour lines that originally came from CAD drawing. I converted these into a polyline shapefile in ArcGIS. The issue I have is with gap in each contour lines that are direct result of CAD text annotations for contour value. These gaps differ in size.

Is there a way to snap multiple lines to their closest nodes at once in ArcMap (or using any other tools)? I attach a screenshot of the contours from ArcMap:


Many thanks in advance, Magda

  • I assume you now have a field called Z or elevation in your shapefile (unless you have a PolylineZ type shapefile). Either way... the best i can think of would be using python with Shapely and Python shapefile libraries to do the joins. Its nasty, but i cant think of any tool that could do this out of the box. Maybe FME Workbench. In Python, i'd to a query to find the nearest polyline with the same z within a specific search distance, and join it together (copy vertices of both into a new polyline)
    – U2ros
    Commented Dec 19, 2012 at 12:36
  • Thank you for all the responses. Great to know tere are multiple approaches to do this operation. I ended up using ET Geowizards which was simple and quick option. Best regards, Magda
    – Magda
    Commented Dec 19, 2012 at 17:34

4 Answers 4


You might be better off exporting each elevation to its own layer. Then you can introduce a snapping tolerance for the lines (like 10m) This will be dependent on the size and length of the gaps.

You might think using Creating lines that connect to other lines it the correct approach: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001t0000002r000000.htm (but is still 98% manual work)

This method below achieves better results faster (more automated).

Then ArcGIS has a Feature to Polygon (Data Management)


enter image description here

This can preserve attributes (elevation) values.

There always might be some manual snapping and cleaning of data (time consuming). tip: use your source data a background check and snapping source to Then you can then convert these back to Lines Lines to Polygons (Data Management)


Geowizards can help out too (under free tools) http://www.ian-ko.com/


Try ET Geowizard’s Clean Contour Gaps tool. Will need elevation field in attributes and to set tolerance in feet for gaps.

  • Can you perhaps provide a link to said tool in your answer and a synopsis on how one could use it?
    – dassouki
    Commented May 31, 2013 at 18:14

You could go back to the cad, create a surface and then make your own contours to match. If you have map 3d or civil 3d. or even if your original cad has elevation values or is in 3d, you can import to polylinez shapefile with that.
Then use your choice of software, esri, autodesk, or opensource to re-create the contours.


CAD work is unavoidable for you. you cant snap the features based on any tolerance. it will increase your headache. you can not assume that the software will itself understand the pattern of contour line in missing portion.

  • You can get close enough with heuristic approaches - see what @U2ros suggested. Commented Dec 19, 2012 at 18:41

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.