GRASS logo

NAME

r.in.ahn - Imports dtm, dsm, chm or laz from the AHN (Actueel Hoogtebestand Nederland (AHN), versions 2–6.

KEYWORDS

dem, raster, import

SYNOPSIS

r.in.ahn
r.in.ahn --help
r.in.ahn [-g] product=string version=string resolution=float [output=name] [directory=name] [laz_files=name] [memory=memory in MB] [nprocs=integer] [max_inputs=integer] [--overwrite] [--help] [--verbose] [--quiet] [--ui]

Flags:

-g
Set to original computational region
After downloading and importing, set the region back to the original computation region.
--overwrite
Allow output files to overwrite existing files
--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--ui
Force launching GUI dialog

Parameters:

product=string [required]
Product
Choose which product to download (dtm, dsm or chm)
Options: dtm, dsm, chm, laz
version=string [required]
AHN version
AHN version to download
Options: 2, 3, 4, 5, 6
Default: 4
resolution=float [required]
Resolution
Resolution in meters (0.5 or 5)
Options: 0.5, 5
Default: 0.5
output=name
Name for output raster map
directory=name
Output directory for LAZ data
Output directory to which the LAZ data is downloaded (default = working directory)
laz_files=name
CSV file with list of downloaded LAZ files
Save the path + names of the downloaded LAZ files to a file
memory=memory in MB
Maximum memory to be used (in MB)
Cache size for raster rows
Default: 300
nprocs=integer
Number of threads for parallel computing
Default: 1
max_inputs=integer
Maximum number of rasters passed to a single r.patch call
Larger values reduce number of intermediate batches but may exceed OS command length limits
Default: 250

Table of contents

DESCRIPTION

r.in.ahn r.in.ahn imports elevation data from the Actueel Hoogtebestand Nederland (AHN). AHN is the national digital elevation model of the Netherlands and provides both a digital terrain model (DTM) and a digital surface model (DSM) at resolutions of 0.5 m and 5 m. The dataset is available in multiple versions (AHN2 through AHN6), each corresponding to a different acquisition period and processing specification. An overview of these versions is provided on the AHN website.

The user specifies the AHN version, the product (dtm, dsm, or chm), and the desired resolution. When chm is selected, the module first downloads and imports both the DTM and DSM and then computes the canopy height model (CHM) as the difference between DSM and DTM. In this case, all three layers are retained and written to the mapset using the user-defined output name with the suffixes _dtm, _dsm, or _chm.

The module determines which 1 × 1 km tiles intersect the current computational region, downloads the required tiles, imports them into the GRASS mapset and combines them in one layer. During this process, the computational region is (temporarily) adjusted so that the imported raster aligns with the native AHN grid and uses the selected resolution. The resulting raster always covers the original region (or the portion overlapping the AHN extent). When the -g flag is used, the original computational region is restored after the import is completed.

In addition to the three raster products, users may also download the LiDAR point cloud tiles by selecting the laz product option. This retrieves the 1 × 1 km LAZ files and stores them in a user-specified directory; if no directory is provided, the files are saved in the current working directory. Optionally, the module can write the file paths and filenames of the downloaded tiles to a CSV file for later reference. Unlike the raster products, LAZ tiles are not imported into GRASS automatically. Users may import the point data afterwards using standard GRASS tools such as v.in.pdal for vector point clouds or r.in.pdal for generating raster products directly from the LAZ files.

NOTE

This module can only be used in a location based on the Amersfoort / RD New coordinate reference system (EPSG:28992). Running it in a location with a different CRS will result in an error.

The computational region is modified during import to ensure that the resulting raster aligns with the AHN grid and matches the chosen resolution (0.5 m or 5 m). If the -g flag is provided, the region is reset to its original extent after the import.

All AHN versions are provided as 1 x 1 km tiles. Earlier datasets (AHN2 -AHN5), originally published as larger map sheets (5 x 6.25 km), have been reprocessed as 1 x 1 km tiles following the AHN6 specification. In the 0.5 m DTM, cell values represent an unweighted average of ground-level points; in the 0.5 m DSM, cell values represent the highest point. The earlier versions retain the original differences related to high-voltage structures: AHN4 DSM excludes high-voltage power lines but includes pylons, while AHN2 and AHN3 DSM include both lines and pylons. See the documentation on the AHN dataroom

Versions 5 and 6 do not cover the whole of the Netherlands yet. Check the AHN website for information about which parts are covered.

EXAMPLE

Example 1

Import the DTM for Fort Crèvecoeur, an fortress where the river Old Dieze flows into the Maas river.

# Set the region for Fort Crèvecoeur
g.region n=416562 s=415957 w=145900 e=147003 res=0.5

# Download the DSM
r.in.ahn product=dtm output=dtm_crevecoeur resolution=0.5 version=4

r.in.ahn example
Figure: DTM map of Fort Crèvecoeur

Example 2

Import the DSM version 5 with a resolution of 5 meter. Set the -g flag flag to keep the current computation region after importing the requested data. Note, the imported data will still have the resolution of, and will be aligned to, the original AHN data.

r.in.ahn -g product=dsm output=dsm_crevecoeur resolution=5 version=4

r.in.ahn example
Figure: DSM map of Fort Crèvecoeur with a resolution of 5m.

Example 3

Import the CHM based on version 4 of DTM and DSM with a resolution of 0.5 meter.

r.in.ahn product=chm output=chm_crevecoeur resolution=0.5 version=4

r.in.ahn example
Figure: CHM map of Fort Crèvecoeur

REFERENCES

See the AHN webpage for more information about the AHN data (in Dutch).

SEE ALSO

r.in.srtm, r.in.nasadem, r.in.pdal, v.in.pdal

AUTHOR

Paulo van Breugel | HAS green academy, University of Applied Sciences | Climate-robust Landscapes research group | Innovative Bio-Monitoring research group | Contact: Ecodiv.earth

SOURCE CODE

Available at: r.in.ahn source code (history)

Latest change: Tuesday Dec 09 16:59:20 2025 in commit: 4a42015b818dff133263746949c4d3268ebd428d


Main index | Raster index | Topics index | Keywords index | Graphical index | Full index

© 2003-2025 GRASS Development Team, GRASS GIS 8.4.3dev Reference Manual