Creating Contour Maps in ArcGIS and Conversion to AutoCAD drawing







A topographic map is simply the two dimensional representation of a portion of three dimensional surface of earth. Topographic maps provide the detailed information about the natural and man-made aspects of the terrain, but are best known for their series of contour lines that show elevation changes, and colors signifying varying land types and bodies of water. Contour lines are used to determine elevations and are lines on a map that are produced from connecting points of equal elevation (elevation refers to height in feet, or meters, above sea level). By reading contour lines, one can measure the steepness of a hill, the height of a mountain, and even the depth of a lake or ocean.
These lines are evenly spaced apart. This spacing is called the contour interval. For example, if your map uses a 10-foot contour interval, you will see contour lines for every 10 feet (3 meters) of elevation -- lines at 0, 10, 20, 30, 40, and so on. Different maps use different intervals, depending on the topography and scale of map. . On USGS maps, contour intervals are usually 1, 5, 10, 20, 40, and 80 feet. On SOP (Survey Of Pakistan) General Topographic sheets, the contour interval is 20 meter or 50 feet.
To increase the readability, the contour lines are classified in two categories; Index and intermediate. Generally, every fifth contour is termed as Index contour and the four contour lines between two index contours are termed as intermediate contours. The index contours are marked as wider or darker as compared to intermediate contours and annotated with elevation/height value.
It is often required for a cartographer to generate contours and display contours using cartographic standards.  Contours can be generated TIN (Triangulation Irregular Network) as well as from DEM (Digital Elevation Model) depending upon the data and software package.
 I am not writing about creation of TIN or DEM, rather I will focus on to create contour maps with standard cartographic representation of contour maps using ArcGIS and Autocad. Using 3D analyst extension in ArcGIS, contours can be generated easily from DEM or TIN. 




Creating Shape File from DEM

Load DEM file in ArcGIS


Enable 3D analyst extension (if disabled)



From 3D Analyst tool bar, select Surface Analysis -> Contour

The contour dialogue will be opened.


Select the input surface from list. Set the contour interval, base contour and the output shapefile and its location. Browse the location to save the shapefile containing Output Features.

The contours will be developed and shapefile containing output features (Contour lines) will be added to the ArcMap document. 


Now, let’s explore the contour shapefile.  Right click on the contour layer in table of contents and click on Open Attribute Table. The attribute table will be shown as below.


CONTOUR field contain the elevation of each contour line. Now we have to classify the contour lines into two classes: index and intermediate. There is no any such field exists which classify the contour lines into index and intermediate contours.  Without classification, we are unable to represent them on Map with cartographic styles and representation.
In order to classify, we need to add an extra field. This filed will be used for classification and will hold its class value. Since, we have classify the contour lines in to two classes we add integer type field. On the attribute table window, click on options and then click on add field button.


Add Field dialogue box will be opened.


Type CLASS in the name textbox as name of the field and and select Short Integer as Type of the field.


Click on OK button.
A field will be added to the attribute table named as CLASS. The default value of 0 (Zero) will be assigned to all records. 


Now, we have to assign the value to the CLASS field for each feature. Since, we have to classify the contours into two classes,  so we assign index contours as 1 and intermediate as 0 for CLASS field.   
As already mentioned, the every fifth contour is index contour and if the contour interval is 10 then contours having elevation 0, 50, 100, 150, 200, 250 and so on will have CLASS value as 1. On the other hand, contours having elevation 10,20,40,60,70,80,90,110,120 and so on will have CLASS value as 0. 
To set the values for CLASS field manually is time consuming and error prone. So we introduce here a VB Script to populate values for CLASS field on the basis of some logic. The logic is so simple. 
The index contours have CONTOUR value of five times the interval i-e 0, 50, 100, 150, 200, 250 and so on.  So, we can say that the index contours have interval of 50 (five times the overall contour interval which is 10 in this case). Hence, the contour line divisible by 50 should be classified as index contour and assigned value of 1 for CLASS field. On the basis of this logic, we have to calculate the value of all contour lines for CLASS field.
Right click on CLASS field header in attribute table and click on Field Calculator





Field Calculator dialogue box will be opened. Click on advanced check box and type the following script in script text box.


dim c as integer

if [CONTOUR] mod 50 = 0 then c =1

and type c in CLASS= expression text box 


Click OK button







Now all the index contours have the value of 1 for CLASS field and intermediate contours unchanged and remain 0. Now, this shapefile can be classified by CLASS field. Further, two individual shapefiles can be created from it and displayed with different symbology.



Saving Contour Map as AutoCAD Drawing.
The cont layer is not 3D. It has the field CONTOUR which preserves elevation value of contour lines but still the shape field shows it is polyline. The geometry of the polyline is 2D and does not contain any 3D information. In order to make it 3D, click on 3D Analyst. Click on Convert and then Features to 3D.





Convert Features to 3D dialogue will be opened. Select the Input features as Contour layer. Set the Source of heights as Input feature attribute. Select CONTOUR for the elevation / height field. Locate the path and name of the output features. 


The value of shape field in attribute table of newly created 3D shapefile is Polyline ZM.



Exporting Contour Map into AutoCAD dwg:
In order to export the contour map into CAD, We will need to make two individual shape files from contour shapefile on the basis of CLASS field. Select the contour features having CLASS value as 1 and export the selected features as Index.shp. Similarly, export the contour features having CLASS value as 0 as intermediate.shp.



 

 

 

Label Index Contours layer. The labels are dynamic. In order to make them static and isolated from feature layer, these should be exported into Geodatabase as annotation layer. Create a personal geodatabase in ArcCatalog. Right click on Index Contour layer and click on Convert Labels to Annotation.

Convert Labels to Annotation dialogue box will appear. Select Store Annotation  as In a database and locate the path of geodatabase and export Labels as Annotation Layer. 

The annotation layers will be added to Map.



The vector layers can be converted into Autocad Drawings using Export To CAD tool from Tool box.  


Click on Export to CAD tool. Export to CAD dialogue will be opened.


Add Index Contours, Intermediate Contours and Index Contour Annotation Layer as input features. Locate the path and name for Output file and Click OK.
Open the DWG file in Autocad. The Index Contours, Intermediate Contours and Annotations will be displayed on different Layers. Set the Colors, Linetypes, Linetype scales etc for all layers individually.





The above procedure seems quite easy but little bit lengthy and needs some extra files to be created. For example, 3D shapefile of contours, two separate files for index and intermediate contours, a geodatabase, an annotation layer. I have developed a software utility which accepts simply a contour shapefile as input and converts it into AutoCAD drawing. Here are the screenshots of the utility.   
 

 


CAD Settings:
Elevation field:  
The attribute or field which contains the elevation value
Contour Interval: 
The contour interval of the contour shapefile
Text Height: 
The text height property of the text object in AutoCAD drawing
Contour Label Interval: 
The spacing between labels along the contour polyline.


 The Contour Shape to CAD Drawing utility can be accessed via The Spatio Cloud Computing Services page. Use following credentials to access this page.

Username: ccic
password: ccic

click  on View button on Plot Contour item as shown below
 Enjoy!!!



 

Comments

  1. its too easy and helpfull for all

    ReplyDelete
  2. Unable to download this utility...? Help please?

    ReplyDelete
  3. Congratulation for this great tutorial, it very helpful and made in such a way that it is very well understood and practicable!

    ReplyDelete
    Replies
    1. The Contour Shape to CAD Drawing utility can be accessed via The Spatio Cloud Computing Services page. Use following credentials to access this page.

      Username: ccic
      password: ccic

      Delete
  4. Am also unable to download the software, my email address is lwitikomulwafu@gmail.com

    ReplyDelete
    Replies
    1. The Contour Shape to CAD Drawing utility can be accessed via The Spatio Cloud Computing Services page. Use following credentials to access this page.

      Username: ccic
      password: ccic

      Delete
  5. The Contour Shape to CAD Drawing utility can be accessed via The Spatio Cloud Computing Services page. Use following credentials to access this page.

    Username: ccic
    password: ccic

    ReplyDelete
  6. It feels entirely appropriate. Every one of smaller aspects were created through many record education. I really like the application plenty Arcgis assignment help

    ReplyDelete
  7. its really informative..Please keep sharing these type of technical issues with us.😄

    ReplyDelete
  8. thanks for sharing informative stuff
    sain from
    https://www.mapever.com/

    ReplyDelete

Post a Comment

Popular posts from this blog

SpaTools: Import Lidar Point Cloud (LAS/LAZ) files into AutoCAD

How to Clip objects in AutoCAD

SpaTools: Extract Topographic Profile From Contours In AutoCAD

SpaTools: Toolbar with all tools

Gunter Chain / Surveyor's Chain