I'm looking for an open source workflow to automate DEM construction. We have a series of sites that fall within a LIDAR dataset. We want to create site specific DEM's for each site, and we're looking to automate the process.

So far, we have automated:

  • data loading into PostGIS (LIDAR and site points)
  • creation of site boundaries (combination of st_buffer and st_envelope)

Now we're looking for options to interpolate the data subsets at each site and export them to Surfer7 grid files.

Currently, we're querying the data in the PostGIS database using QuantumGIS, exporting to csv files, then manually importing and gridding the data in Surfer7. Hopefully we can automate this as well.

So for this use case, we'd like to triangulate our lidar data to a DEM. Other potential cases we can think of involve different interpolation methods - so if there are options for inverse distance and kriging - we're interested!

This is very much a learning exercise for us - we're working in baby steps!

  • 2
    I'd say you are ahead of the development team, whom have been discussing bringing the pointcloud datatype to PostGIS, and will hopefully be working on it soon. In the mean time, there is a points2grid utility for PDAL that looks interesting, but I haven't used it.
    – Mike T
    Dec 17, 2012 at 3:08

2 Answers 2


You could do this automation with SAGA, in Windows or in Linux. SAGA can handle big point data sets, imported in SAGA format as pointcloud format (spc). Then you have functions for interpolation or triangulation, and also export to Surfer. The automation is performed by using SAGA command tool.

  • Import to CVS, you can put this to bashscript with psql command COPY (SELECT foo,bar FROM whatever) TO '/tmp/ouput.csv' DELIMITER ',' CSV HEADER; With that you can drop QGIS from tool chain Mar 18, 2013 at 8:03

If you have the original LIDAR data in .las/laz, you might use lastools, http://www.cs.unc.edu/~isenburg/lastools/ to deal with big LiDAR data. There's a las2tin and las2dem that look like they'd work directly, but I haven't used them. I have used the below to assemble a set of .laz files into a raster DEM within GRASS:

cat *.laz |~/Downloads/SRC/lastools/bin/las2txt -stdin  -parse xyztc -header pound -otxt |invproj -v -f %.9f +init=epsg:2284 |sed -e 's// /' | r.in.xyz input=- output=lidarJunk method=min type=FCELL x=1 y=2 z=3 fs=\    zscale=1.0 percent=100 --overwrite  
# the sed and fs=\ bits are for dealing with reformatting spaces and tabs between invproj and r.in.xyz

Lastools would automate well, and look like they could clip the data for a DEM or TIN to bounds of your choice.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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