Monday 21 November 2022

Creating a Civil 3D surface from an Esri ASCII raster

Digital terrain models, such as LiDAR data, are frequently stored in Esri ASCII raster files (*.asc). In this blog, we'll explain the structure of the data in this file type and walk through the workflow of creating an ASC file into a Civil 3D surface.

An esri ASCII raster file holds the elevation of several square cells that make up a grid in the context of digital terrain models. You may see the data that makes up the file if you open it in a text editor like notepad. It starts with a header that defines the properties of the grid followed by the data, with the grid cells elevations separated by spaces.

A list of parameters that are part of the header are listed below:

·         ncols: number of cell columns.

·         nrows: number of cell rows.

·         xllcorner or xllcenter: x coordinate of the lower left corner (or centre) of the origin cell, located in the lower left corner of the grid.

·         yllcorner or yllcenter: y coordinate of the lower left corner (or centre) of the origin cell, located in the lower left corner of the grid.

·         cellsize: size of each of the square cells.

·     NODATA_value: value that designates that no data exists for a particular cell. This parameter is optional and may not exist.

The data that follows is a list of elevations, listed from top to bottom and left to right, divided by spaces.  In other words, the elevation of the upper left cell is the first value, followed by the elevation of the second leftmost cell from the top row etc. The values are typically organised into separate lines that correspond to the various rows, with the first line representing the row at the top of the raster. The number of columns determines when the next row starts, so carriage returns are not required at the end of each row.

Raster grid

The two examples below show the same raster grid, using the coordinates of the corner or the centre of the origin cell.


Checking coordinate systems

We must ensure that the coordinate system is set correctly, before creating a surface from an ASC file in Civil 3D. It can be set from ‘Edit Drawing Settings…’, as shown below.




Creating a new surface

We then begin by creating a new surface.




For points that lie in a regular grid, it is advised to use a grid surface rather than a TIN or triangulation surface. A grid surface will load more quickly than a TIN surface since it uses less disc space, especially if the number of points is high.

Grid X-spacing and grid Y-spacing should be set to the ‘cellsize’ parameter from the header of the ASC file.




Adding a DEM file

From prospector, look for the surface and add the DEM file from the ‘Definition’ branch.


Browse to the ASC file and set ‘Use custom null elevation’ to ‘Yes’ if the ‘NODATA_value’ parameter is part of the header in the ASC file. In that case, ‘Null elevation’ should be set to the ‘NODATA_value’ parameter. If that number is found in the file, it will be ignored, and no point will be created for that particular grid cell. If you don’t use a custom null elevation, it will create a point at that level (-9999m in our example), which is incorrect.





Civil 3D Surface

After confirming the previous dialog, the surface will be generated.


A point will be created at the centre of each grid cell. In the picture below, the grid from the ASC file is shown in cyan, the boundary of the surface in red, and the surface triangles in white. The coordinates and levels that have been labelled can be found in the example files that we showed at the start of the blog.



If you would like to learn more about Civil 3D, please visit our product page. Alternatively, you can contact SYMETRI on 0345 370 1444 or email us at info@symetri.co.uk.


No comments:

Post a Comment

What’s New in AutoCAD Electrical 2025

This blog will examine what’s new in AutoCAD Electrical 2025. Automatic Reports Enhancement In AutoCAD Electrical 2025, you can now cre...