PCI Geomatics Help Center

How can we help you today?

DEM Creation from 3D Vectors - Python Script

PCI Geomatics -

This script corresponds to the DEM generation from 3D vector workflow that is outlined in this tutorial: https://support.pcigeomatics.com/hc/en-us/articles/203482869-DEM-Creation-from-3D-Vectors.

Please see the tutorial for additional information on this workflow.

In order to use this script, you will need to copy the script into an IDE or Notepad, adjust the Input Files variables (point_file, breakline_file) and Output File variables (output_vec, index) to match your data. You can then save the script as a .py file (i.e. DEM_From_Vector.py).

You can then run the script through the IDE or CMD. To run in CMD, navigate to the folder that contains the python (.py) file and then type python DEM_From_Vector.py.


from pci.vdemingest import vdemingest
from pci.vdemsetup import vdemsetup
from pci.vdemint import vdemint

# Input Files
point_file = r"D:\Data\Contour_DEM\points\Point.shp"
breakline_file = r"D:\Data\Contour_DEM\breaklines\Polyline.shp"

# Output Files
output_vec = r"D:\Data\Contour_DEM\vdemingest_vectors.pix"
index = r"D:\Data\Contour_DEM\DEM.txt"

# Ingest the various vector files and merges them into vector segments in a PIX file
vdemingest(points=point_file, breaklin=breakline_file, filv=output_vec)

# Create index file that contains a list of raster-DEM files to generate with VDEMINT
vdemsetup(filv=output_vec, indexfil=index, demtype="PIX", dempxsz=[2, 2], elevunit="METER", elevref="MATHMODEL")

# Generate the raster DEMs from the index file by interpolating elevation values from input vectors
vdemint(file=index, dboc=[1], filv=output_vec, maxiter=[10])


Have more questions? Submit a request


Powered by Zendesk