h2. General

The [Actueel Hoogtebestand Nederland|http://www.ahn.nl] versie 2 (AHN2), was made available 2014-03-06. The dataset covers the topography of the Netherlands (nl), measured from 2011 through 2012.

{html}
<img src="http://lab.linkeddata.deri.ie/2010/lod-badges/img/data-badge-3.png" alt="three star open Web data" />
{html}


h2. Formats

The data is available in pointclouds (las) and as a map (tiff).


h2. Services

Using the AHN2 as a background map can be done using one of the OGV web services:

The full list is available at [https://www.pdok.nl/nl/producten/pdok-services/overzicht-urls].  The relevant url's are:
WMS:
- [http://geodata.nationaalgeoregister.nl/ahn1/wms?]
- [http://geodata.nationaalgeoregister.nl/ahn2/wms?]

WFS:
- [http://geodata.nationaalgeoregister.nl/ahn1/wfs?]
- [http://geodata.nationaalgeoregister.nl/ahn2/wfs?]

WMTS:
- [http://geodata.nationaalgeoregister.nl/tiles/service/wmts/ahn1?]
- [http://geodata.nationaalgeoregister.nl/tiles/service/wmts/ahn2?]

WCS
- [http://geodata.nationaalgeoregister.nl/ahn1/wcs?]
- [http://geodata.nationaalgeoregister.nl/ahn2/wcs?]

If you're using QGIS you can use the [PDOK plugin|http://plugins.qgis.org/plugins/pdokservicesplugin/] which is very [handy|http://www.qgis.nl/2012/10/20/eenvoudige-pdok-services-plugin-voor-qgis/] (in dutch).

h2. Downloading

To download the data use one of the atomfeeds to get a list of files.

[https://www.pdok.nl/nl/producten/pdok-downloads/atomfeeds]



h2. Examples

h4. Qgis

Load the [PDOK plugin|http://plugins.qgis.org/plugins/pdokservicesplugin/]. Add the AHN2 WMTS service from the list (for viewing). You should see something like:

!ahn2_in_qgis.png|thumbnail!

h4. Python

The [OWSlib|http://geopython.github.io/OWSLib/] package is demonstrated in this [Python Notebook|http://ipython.org/notebook.html]: [https://svn.oss.deltares.nl/repos/openearthtools/trunk/python/notebooks/ahn2.ipynb] accessible after free [registration|Join OpenEarth] for OpenEarth.

h4. Web browser

For using WMS or WCS in a we browser see our [WMS Primer] or [WCS primer]:

{{[http://geodata.nationaalgeoregister.nl/ahn2/wms?service=WMS&request=GetMap&layers=ahn2_5m&width=800&height=600&bbox=94000,466000,96000,468000&crs=epsg:28992&format=image/png]}}

!ahn2-ahn2_5m.png!


h4. Matlab

OpenEarthTools has Matlab OGC functions {{wcs}} and {{wms}} for using the AHN(2) web services, which can be dowloaded [here|https://svn.oss.deltares.nl/repos/openearthtools/trunk/matlab/applications/arcgis/] accessible after free [registration|Join OpenEarth] for OpenEarth. We use WCS here so we can use our own colormap to highlight details (West of Netherlands is roughly between -5 for polders and +25 for dunes) rather then WMS which has a fixed colormap (needed to accommodate the full DEM range incl. Vaalserberg at +322m)

{code}
server = 'http://geodata.nationaalgeoregister.nl/ahn2/wms?';
[url,OPT,lim] = wcs('server',server,...
    'coverage','ahn2:ahn2_5m',...
    'format','GeoTiff',... % only format offered
    'crs','epsg:28992',... % RD
    'axis',[94000 466000 96000 468000],... % around Kaag
    'resx',5,'resy',5); % 5m, native resolution

urlwrite(url,['tmp',OPT.format]);

im = imread(['tmp',OPT.format]);
im(im<-3.402e+38)=NaN;  % ahn2
%im(im==-32768   )=NaN;  % ahn1
pcolorcorcen(OPT.x,OPT.y,double(im))
tickmap('xy')
{code}

!ahn2_ahn2_5mGeoTIFF.png!
_Note the elevated railway track, the higher elevations of the old dunes of Warmond, the lower elevations in the peat/polders in Leiden North, the deblanked waterways, the townhouse blocks with the deblanked ditches, but also the unfiltered points band in the Kaag lake._

h4. Other

Grontmij made a nice [overview of possible use cases|http://www.slideshare.net/XanderBakker/ahn2-voor-waterbeheer-gis-conferentie-2012-grontmij].

h2. Issues

The WCS of PDOK.nl does not seem to support v1.1.0, only 1.0.0 and 1.1.1.
The WMTS layer does not seem to work when zoomed out in QGIS.
The elements in the  [georss feed|http://geodata.nationaalgeoregister.nl/ahn2/atom/ahn2_gefilterd.xml] all have the same polygon (50.6 3.1 50.6 7.3 53.7 7.3 53.7 3.1 50.6 3.1). There is a kaartblad_index layer in the WFS. This can be used to find the correct coverage of each las file.
h2. Structured info

The following text follows the [schema.org|http://schema.org] convention and is used for structured search engines. See html source for details.
{html}
<!-- Metadata in schema.org format -->
<div itemscope itemtype="http://schema.org/Dataset">
    The <a href="http://www.ahn.nl" itemprop="name">Actueel Hoogtebestand Nederland</a> versie 2
    (<span itemprop="name">AHN2</span>), was made available <span  itemprop="datePublished">2014-03-06</span>.
The dataset covers the topography of <span itemprop="spatial"  itemscope itemtype="http://schema.org/Country">the Netherlands (<span itemprop="address">nl</span>)</span>, measured <span itemprop="temporal" itemscope itemtype="http://schema.org/DateTime"> from <span itemprop="startTime">2011</span> through <span itemprop="endTime">2012</span>.
  </div>
{html}