Skip to content

Commit

Permalink
WIP add GEBCO bathymetry layer
Browse files Browse the repository at this point in the history
The GEBCO grid is global, so we can cover all of the QGreenland background this
way (IBCAO only covers a relatively small area around Greenland)

This layer is actually smaller than IBCAO (it has an `int` dtype), even at the
same resolution!
  • Loading branch information
trey-stafford committed Jun 26, 2023
1 parent 4cf66f1 commit d0b1185
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
36 changes: 36 additions & 0 deletions qgreenland/config/datasets/bathymetric_chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,39 @@
},
},
)

gebco_bathymetric_chart = Dataset(
id="gebco_bathymetric_chart",
assets=[
HttpAsset(
id="only",
urls=[
"https://www.bodc.ac.uk/data/open_download/gebco/gebco_2023/zip/",
],
),
],
metadata={
"title": "General Bathymetric Chart of the Oceans (GEBCO) Grid 2023",
"abstract": (
"""The GEBCO_2023 Grid is a global terrain model for ocean and land,
providing elevation data, in meters, on a 15 arc-second interval
grid of 43200 rows x 86400 columns, giving 3,732,480,000 data
points. The data values are pixel-centre registered i.e. they refer
to elevations, in meters, at the centre of grid cells.
The grid was published in April 2023 and is the fifth GEBCO grid
developed through The Nippon Foundation-GEBCO Seabed 2030
Project. This is a collaborative project between the Nippon
Foundation of Japan and GEBCO. The Seabed 2030 Project aims to bring
together all available bathymetric data to produce the definitive
map of the world ocean floor and make it available to all."""
),
"citation": {
"text": (
"""GEBCO Compilation Group (2023) GEBCO 2023 Grid
(doi:10.5285/f98b053b-0cbc-6c23-e053-6c86abc0af7b)"""
),
"url": "https://www.gebco.net/data_and_products/gridded_bathymetry_data/",
},
},
)
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
from qgreenland.config.datasets.bathymetric_chart import bathymetric_chart as dataset
from qgreenland.config.datasets.bathymetric_chart import gebco_bathymetric_chart
from qgreenland.config.helpers.layers.geological_map import make_layer
from qgreenland.config.helpers.steps.compress_and_add_overviews import (
compress_and_add_overviews,
)
from qgreenland.config.helpers.steps.decompress import decompress_step
from qgreenland.config.helpers.steps.warp import warp
from qgreenland.config.helpers.steps.warp_and_cut import warp_and_cut
from qgreenland.config.project import project
from qgreenland.models.config.layer import Layer, LayerInput

Expand Down Expand Up @@ -80,6 +83,43 @@
)


_background_boundary = project.boundaries["background"]
_background_bbox = _background_boundary.bbox
gebco_bathymetric_raster = Layer(
id="gebco_bathymetric_raster",
title="GEBCO depth",
description=bathymetric_raster_params["description"],
tags=[],
style=bathymetric_raster_params["style"],
input=LayerInput(
dataset=gebco_bathymetric_chart,
asset=gebco_bathymetric_chart.assets["only"],
),
steps=[
decompress_step(input_file="{input_dir}/gebco_2023.zip"),
*warp_and_cut(
input_file="NETCDF:{input_dir}/GEBCO_2023.nc:elevation",
output_file="{output_dir}/bathymetric_chart.tif",
reproject_args=(
"-te",
f"{_background_bbox.min_x} {_background_bbox.min_y} {_background_bbox.max_x} {_background_bbox.max_y}",
"-dstnodata",
"-9999",
"-tr",
"400",
"400",
),
cut_file=project.boundaries["background"].filepath,
),
*compress_and_add_overviews(
input_file="{input_dir}/bathymetric_chart.tif",
output_file="{output_dir}/bathymetric_chart.tif",
dtype_is_float=False,
),
],
)


bathymetric_contours = make_layer(
layer_id=bathymetric_contours_params["id"],
layer_params=bathymetric_contours_params,
Expand Down

0 comments on commit d0b1185

Please sign in to comment.