Creating a DEM with Civil 3D

imageOne of my users called me the other day asking if there was any way to convert our DTM surface into a DEM surface, as a client had called them asking if it was possible.  The short answer to the question was yes, but let me review the fundamental differences in these formats before getting into the how-to of this task.  Both formats exist for the same fundamental reason – to capture a representation of the earth’s surface.  What differs is the way each stores that data.

Format Differences

A DEM or Digital Elevation Model stores this information using a predefined grid of squares.  Thus imagine a piece of graph paper; at each point two graph lines intersect, an elevation will be assigned.  This format is an effective way of representing surfaces, but due to it’s rigid nature isn’t necessarily the best choice for civil engineering design.  And it is with that we have our second format – DTM or Digital Terrain Model.  Unlike a DEM, a DTM captures a surface through the use of a triangular irregular network.

In essence, rather than using squares to capture a surface, a DTM uses triangles.  At the corner of each respective triangle, an X, Y, & Z elevation is captured and stored.  Since the triangular network is irregular, the TIN is generally better at capturing things like flow lines.

Overcoming Format Limitations

Although Civil 3D’s native modeling format is DTM, it does have the ability to export a surface to a DEM file.  In addition to the architectural differences between DEM and DTM surfaces, the DEM format only accepts metric coordinate systems.  International users don’t necessarily have to worry about this detail, but those using imperial coordinate systems will need to convert their surface to a metric coordinate system.

As we’ll see later the “Export to DEM” command within Civil 3D lists both the source coordinate system, and the coordinate system to the to-be-exported DEM.  Generally speaking whenever Civil 3D lists both an input and output coordinate system, you can assume Civil 3D will do the heavy lifting of converting from one system to another.  Unfortunately the “Export to DEM” command is an exception to that rule.  As stated in the Civil 3D help file:

image

With that said we’ll have to perform the coordinate conversion manually.  For purposes of this post I am going to use the LandXML format as a carrier to convert from one coordinate system to another.

Conversion Procedure

  1. Right-Click on the surface name and select “Export LandXML”
     image
  2. Since all we’re interested in is our surface, accept the defaults and press [Ok] to save your XML file.
  3. Create a new drawing (File > New), and select a Metric drawing template (ie. _AutoCAD Civil 3D (Metric) NCS Extended.dwt)
  4. Set the datum of your new DWG file
  1. From the Civil 3D Toolspace select the “Settings” tab.
  2. Right-Click on the DWG name and select “Edit Drawing Settings”
    image
  3. Select an appropriate metric coordinate system
    image
  • Import your XML surface by going to File > Import > Import LandXML.  Selecting your XML file from the resulting dialog.
    image 
  • From the “Prospector” tab of the Civil 3D Toolspace, Right-Click on the surface name and select “Export to DEM”
    image
  • Generally speaking you can accept the defaults from the resulting “Export Surface to DEM” dialog.  One setting you may experiment with is the “Grid spacing”; the larger the number the less accurate your DEM.  Aside from that, simply specify an output file name and press [Ok]. image
  • Read more about using AutoCAD Map 3D to analyze DEM surfaces in my September / October 2007 AUGIWorld Article “Finding the 3D in Map 3D: Surface Visualization

    Donnie Gladfelter
    Donnie Gladfelter

    Donnie is author of the book and Autodesk Official Press, AutoCAD and AutoCAD LT: No Experience Required, a columnist for AUGIWorld Magazine, Autodesk University speaker, and former member of the AUGI Board of Directors.

    20 Comments

    1. Hy sir
      i hope this blog is been active until you read my comment..!!

      i had some little trouble on my civil 3d map 2013, when i have done import point to my civil 3d map 2013 and after that i make zoom and extent after that when i trying to zoom in and out with my mouse scroll
      my windows told me and say “this application has been stoping try to force stop”
      would you help how to fixed that sir…??
      thank you before

    2. Can you show how to PENZ files import to AutoCAD Civil 3D, process them and make a file that I can use in Surpac for making a 3D model. Also, I have that map of terrain in a dwg AutoCad file with polylines and x,y,z coordinates for points. I think that I need to create a string or dtm file for Surpac. Thanks…

    3. Using your method, I successfully exported a DEM from Civil 3D, and would like to import it into ArcGIS. When I do this, I receive this error message:

      “one or more of the layers has an extent inconsistent with the associated spatial reference information.”

      Do you have any idea why I might be seeing this, and if I can see it on the CAD side?

      Thanks!

      • You generally see those kinds of messages when there is a missing projection file.  Try defining projection of raster using ArcToolbox (either in ArcCatalog or ArcMap) to the coordinate system that you are using. If there is already a projection defined, then reproject raster to a similar coordinate system of your data.  Hope this helps.

    4. I’ve been trying to export DEM’s from Civil 3D but have noticed that my elevation accuracy gets lost, and rounded up to a whole number (no decimals). Is there a way to export to a DEM and maintain a reasonable accuracy in the elevations?
      I’ve tried fiddling with some of the parent drawing settings, but cannot seem to find anything that will allow me to transfer the data to DEM with anything but a “nice” round number.
      Thanks!

    5. I saw your blog on creating a dem file from tin surfaces in Civil 3D. I have a question: is it possible to select multiple surfaces in order to create one dem file? If you know of a way please educate me on this matter. I am rushing of course with work material and this is where I am holding up. Any help would be much appreciated.

      Thank You,

      Kristina Mohos
      Staff Geologist / CAD Drafter
      Genterra Consultants, Inc.
      15375 Barranca Parkway, Suite K-102
      Irvine, CA 92618
      (949) 753-8766 or (818)261-0346

    6. I saw your blog on creating a dem file from tin surfaces in Civil 3D. I have a question: is it possible to select multiple surfaces in order to create one dem file? If you know of a way please educate me on this matter. I am rushing of course with work material and this is where I am holding up. Any help would be much appreciated.

      Thank You,

      Kristina Mohos
      Staff Geologist / CAD Drafter
      Genterra Consultants, Inc.
      15375 Barranca Parkway, Suite K-102
      Irvine, CA 92618
      (949) 753-8766 or (818)261-0346

    7. @Earl – Since I almost always work in State Plane Foot coordinates, it seems I may have mispoken on the metric thing. In this case I was working in State Plane Foot, and the only coordinate system accepted was the State Plane Metric. In any case I do appreciate your detailed comment. Here in Virginia the coordinate shift isn’t as drastic as it seems to be there in Alaska. Thanks again!

      Donnie

    8. @Earl – Since I almost always work in State Plane Foot coordinates, it seems I may have mispoken on the metric thing. In this case I was working in State Plane Foot, and the only coordinate system accepted was the State Plane Metric. In any case I do appreciate your detailed comment. Here in Virginia the coordinate shift isn’t as drastic as it seems to be there in Alaska. Thanks again!

      Donnie

    9. Hey Donnie, nice blog.

      I’m not finding anything in the DEM file specification that says it must be in a metric coordinate system. The early USGS DEMs were in UTM, which is metric by definition, yet the USGS spec allowed imperial units for elevation. Meanwhile, newer DEMs, non-US (at least Canadian that I have experience with) are gridded on lat/long, which is definitely not metric.

      Meanwhile, there is no mathematical reason for a DEM to need any given system.

      The tricky part, and the reason you need to convert to the desired coordinate system BEFORE you output to DEM (and why you can’t read from DEM to a grid surface with translation) is that a square, when transformed into another coordinate projection, is no longer a square! Sometimes it may appear so out to a number of decimal places, but mathematically it ain’t so.

      Especially for lat-long – in my latitude (Anchorage, Alaska) lat/long DEMs project out no something closer to 2x rectangles in UTM or State Plane.

    10. Hey Donnie, nice blog.

      I’m not finding anything in the DEM file specification that says it must be in a metric coordinate system. The early USGS DEMs were in UTM, which is metric by definition, yet the USGS spec allowed imperial units for elevation. Meanwhile, newer DEMs, non-US (at least Canadian that I have experience with) are gridded on lat/long, which is definitely not metric.

      Meanwhile, there is no mathematical reason for a DEM to need any given system.

      The tricky part, and the reason you need to convert to the desired coordinate system BEFORE you output to DEM (and why you can’t read from DEM to a grid surface with translation) is that a square, when transformed into another coordinate projection, is no longer a square! Sometimes it may appear so out to a number of decimal places, but mathematically it ain’t so.

      Especially for lat-long – in my latitude (Anchorage, Alaska) lat/long DEMs project out no something closer to 2x rectangles in UTM or State Plane.

    Leave a Reply to JenCancel reply

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

    Discover more from The CAD Geek

    Subscribe now to keep reading and get access to the full archive.

    Continue reading

    Discover more from The CAD Geek

    Subscribe now to keep reading and get access to the full archive.

    Continue reading