AHN
AHNService
Bases: BaseModel
get_tiles(model='dtm', cell_size='05', ahn_version=4)
Get AHN tiles in a GeoDataFrame
get_tiles_url(model='dtm', cell_size='05', ahn_version=4)
Get tiles url of AHN download service
create_download_dir(root_dir, model='dtm', cell_size='05', ahn_version=4)
Create a logic/unique download_dir as sub-directory of root_dir
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
root_dir
|
Path
|
Root directory to create sub-directory for |
required |
model
|
Literal["dtm", "dsm"]
|
ahn model-type, by default "dtm" |
'dtm'
|
cell_size
|
Literal["05", "5"]
|
ahn cell_size, by default "05" |
'05'
|
ahn_version
|
Literal[1, 2, 3, 4, 5, 6]
|
ahn version, by default 4 |
4
|
Returns:
| Type | Description |
|---|---|
Path
|
ahn_directory |
get_ahn_rasters(ahn_dir=datastore.ahn_dir, poly_mask=None, select_indices=None, model='dtm', cell_size='05', ahn_version=4, service='ahn_pdok', missing_only=True, create_vrt=True, save_tiles_index=False)
Downloads AHN rasters
Downloads ahn DTM or DSM rasters on 0.5m or 5m resolution
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ahn_dir
|
Path
|
Directory to store ahn-files. Defaults to datastore.ahn_dir |
ahn_dir
|
poly_mask
|
Polygon | None
|
Mask to select ahn-tiles, by default None |
None
|
select_indices
|
list[str] | None
|
Indices to select, by default None |
None
|
service
|
Literal['ahn_pdok', 'ahn_datastroom']
|
Switch for using pdok.nl or ahn.nl for downloading ahn_data |
'ahn_pdok'
|
missing_only
|
bool
|
Only download rasters not yet existing in download_dir, by default True |
True
|
create_vrt
|
bool
|
Create a vrt-file so all tiles can be opened as one, by default True |
True
|
save_tiles_index
|
bool
|
Save the tile index as a GeoPackage in the download-dir, by default False |
False
|
Returns:
| Type | Description |
|---|---|
Path
|
Path to download dir or vrt_file, being a sub-directory of ahn_root_dir |
interpolate_ahn_tiles(ahn_vrt_file, indices=None, max_search_distance=100, dir_name='ahn_filled', create_vrt=True, missing_only=False)
Interpolate ahn raster tiles
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ahn_vrt_file
|
Path
|
VRT file referring to AHN tiles |
required |
indices
|
list[str] | None
|
Optional selection of AHN tiles to interpolate, by default None |
None
|
max_search_distance
|
float
|
Set search_distance for neighbor search and interpolation distance. By default set to 100 |
100
|
dir_name
|
str
|
Optional output dir-name within datastore to store result, by default "ahn_filled" |
'ahn_filled'
|
create_vrt
|
bool
|
Switch for generating a vrt-file for resulting rasters, by default True |
True
|
missing_only
|
bool
|
Interpolate only rasters that haven't been interpolated yet, by default False |
False
|
Returns:
| Type | Description |
|---|---|
Path
|
Path to VRT-file (create_vrt=True) or destination directory |