Skip to content

← Blog

Contour lines from a LAS/LAZ point cloud in DWG

· Guides

The screenshots show the Spanish interface; commands and options are given as they appear in the English version of the program.

LiDAR flights produce point clouds with millions of ground elevations, in LAS files or in their compressed version, LAZ. In Spain, the National Aerial Orthophotography Plan (PNOA) publishes LiDAR point clouds of the country in the CNIG Download Center (Centro de Descargas del CNIG). To bring that terrain into a drawing, you need to triangulate it (a DTM, or TIN) and derive the contour lines from it. In LinceCAD the three steps are on the Topography tab, and the result stays in the DWG.

LinceCAD demo: POINTCLOUD loads a PNOA LiDAR tile in LAZ, TIN builds the triangulated surface and CONTOUR draws contour lines every 2 m, with index contours every 10 m (24 s, no sound). LiDAR-PNOA 2023 © Instituto Geográfico Nacional (CC BY 4.0). The video shows the Spanish interface: IMPORTARNUBE, MDT, CURVASNIVEL is POINTCLOUD, TIN, CONTOUR in English.

What you need

Step 1: import the point cloud with POINTCLOUD

  1. Set the drawing's system with GEOGRAPHICLOCATION (for example, 25830) and create a layer for the points, for example CLOUD.
  2. Type POINTCLOUD or click Import point cloud on the Topography tab, Points group.
  3. Choose the file with Browse…. The dialog box shows how many points it has and how many will remain after subsampling.
  4. Set Maximum points (1,000,000 by default). If the file has more, 1 out of every N points is kept, spread across the whole cloud.
  5. Choose the Point colour: the layer's, the flight's RGB, intensity, class or elevation.
  6. Check the File coordinate system: if the file includes one, the points are reprojected to the drawing's system; if it shows “none”, choose it by hand, or leave it like that when the file is already in the drawing's system. Click OK.
LinceCAD “Importar nube de puntos (LAS/LAZ)” dialog box (Import point cloud, Spanish interface) with a PNOA LAZ file of 4,834,777 points (966,956 after subsampling), a maximum of 1,000,000 points, RGB color and the drawing system ETRS89 / UTM zone 30N.
The POINTCLOUD dialog box with a PNOA LiDAR tile.

Each point comes in as a normal DWG point object, with its elevation, on the current layer. It shows in the 2D view and in the 3D view.

LiDAR point cloud of a 1 × 1 km tile in Murcia, colored with the flight's RGB: farm plots, tracks, a road, trees and an irrigation pond.
The imported cloud, colored by RGB. LiDAR-PNOA 2023 © Instituto Geográfico Nacional (CC BY 4.0).

Step 2: create the DTM

Create a layer for the surface (TIN), type SURFACE or click Surface (TIN) in the Terrain group, and select the points. The command then asks for:

The triangulation is Delaunay and is saved as a polyface mesh, which any DWG program reads. Since the format allows at most 32,767 vertices or faces per mesh, a larger DTM is saved as several meshes in strips, which are selected and edited as one. The constraints are saved with the mesh, so that it can be edited later with EDITSURFACE.

Step 3: draw the contour lines

Type CONTOUR or click Contours and select the surface (if the points are on another layer, freeze it first so you do not select them at the same time). In the Contours dialog box, or on the command line, specify:

  1. The interval between contours.
  2. How often a contour is an index contour (0, none).
  3. The smoothing: None (the contours follow the triangles), Polyline or Spline. Smoothing is done on the surface, not contour by contour, so two neighboring contours do not cross.
  4. The spacing in meters between labels on the index contours (0, no labels).

The contours are polylines (or splines) at their elevation: the intermediate ones on the CN_FINA layer and the index ones on CN_MAESTRA. The labels read from left to right and break the contour, instead of covering it with a mask, so that they look the same in any program. If the surface has breaklines, the contours bend at them.

Contour lines every 2 m in green and index contours every 10 m in orange over the LiDAR point cloud of the tile; around the trees and buildings there are many small closed contours.
Contours every 2 m, index contours every 10 m. LiDAR-PNOA 2023 © Instituto Geográfico Nacional (CC BY 4.0).

A real example: a PNOA tile

We made the screenshots with a 1 × 1 km 2023 PNOA LiDAR tile in the Region of Murcia: the DTM with the default values and the contours every 2 m, smoothed as polyline and labeled every 200 m:

ItemValue
FilePNOA_2023_MUR_650-4257_H30_NPC02.LAZ (21 MB)
Points in the file4,834,777
Points imported (cap of 1,000,000)966,956
DTM faces1,931,365
Contour lines (2 m interval, index every 5)37,903, of which 7,746 index contours, with 57 labels
Resulting DWG, with the cloud, the DTM and the contours110 MB

In our tests, the import, the DTM and the contours took less than a minute in total. The number of contours is high for a reason you can see in the image: the cloud includes trees and buildings, and each one raises its own small “hill” in the surface. We explain it in the limitations.

Close-up of the contour lines next to an irrigation pond: the index contour at elevation 530 goes around the pond with its labels, the intermediate contours run across the plots and each tree is surrounded by small closed contours.
Close-up next to the pond, with the 530 index contour labeled. LiDAR-PNOA 2023 © Instituto Geográfico Nacional (CC BY 4.0).

After the contours

If you do not have a point cloud, IMPORTDEM reads the CNIG grid DEMs (ASCII Grid or GeoTIFF) and IGNDEM downloads the one for the visible area from the IGN elevation service. You can put the orthophoto under the contours: we explain it in how to import the Spanish cadastral map and the PNOA orthophoto into a DWG.

Limitations

Frequently asked questions

Can I import total station or GNSS points? Yes, with IMPORTPOINTS, which reads CSV and the Leica, Sokkia, Topcon, Trimble and Carlson formats; the DTM and the contours are done the same way.

Can it be automated? LinceCAD has AutoLISP, scripts and a local API for Python: how to automate DWG drawings with Python.

What if the topographic map I have is a scan? You can vectorize it, although the contours will come out without elevations: how to vectorize a scanned drawing and convert it to DWG.

LAS/LAZ point clouds, DTMs and contour lines come as standard in LinceCAD, with a perpetual license. Download · See pricing · Topography and all other features.