Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
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 Dec 19 '12 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 Dec 19 '12 at 17:34
up vote 1 down vote accepted

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

share|improve this answer
Can you perhaps provide a link to said tool in your answer and a synopsis on how one could use it? – dassouki May 31 '13 at 18:14

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 line*s it the correct approach: (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)

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer
You can get close enough with heuristic approaches - see what @U2ros suggested. – lynxlynxlynx Dec 19 '12 at 18:41

Your Answer


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

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