Skip to content

Schema

To work with the data base, it helps to understand its public schema. The landslides data base follows a simple, well‑structured layout. A screenshot is shown below:

Landslides View in the API preview
The data base schema.

Each table is described in detail below.

Table Description

Let's break down each table and have a closer look.

TableDescription
alembic_versionSingle row containing the Alembic migration version.
spatial_ref_sysCoordinate reference systems (CRS) available.
landslidesEvent records (e.g., rockfalls, debris flows, ...) with date and point geometry.
classificationLookup table with classification labels used by the landslides table.
sourcesMetadata about original data sources linked to event records.

alembic_version

Migration of the data base is done with the Python package alembic. "Alembic provides for the creation, management, and invocation of change management scripts for a relational database, using SQLAlchemy as the underlying engine."[1]

The alembic_version table is automatically added by the tool, it serves as information.

INFO

Alembic is used to auto-generate the schema from the models defined with sqlalchemy. The alembic migration scripts are in alembic/versions/.

spatial_ref_sys

The spatial_ref_sys table is included in every PostGIS data base and stores coordinate reference system (CRS) definitions (SRID, proj4/WKT text). In PostGIS each geometry is linked to an SRID. For example, the landslides table contains events including point geometries (longitude, latitude) that are linked to an SRID. The spatial_ref_sys table is used to interpret that SRID.

landslides

The landslides table contains the mass movement events, including a event date (date) and point geometry (geom). All records are linked to source and classification via the source_id and classification_id respectively. Find the first two records below:

iddategeomsource_idreportreport_sourcereport_urlclassification_id
12024-11-010101000020787F...1NULLNULLNULL1
22024-10-220101000020787F...1NULLNULLNULL1
Details

The SQL query for above table:

sql
SELECT *
FROM public.landslides
LIMIT 2;

Column Overview

Some fields are nullable whereas other must always be present, see below table for an overview.

FieldNullableDescription
dateNoEvent date
geomNoPoint geometry in EPSG:32632
source_idNoForeign key to the sources table
reportYesOptional report describing the event
report_sourceYesOptional name of the report source
report_urlYesOptional URL linking to the original report/resource
classification_idNoForeign key to the classification table

INFO

Geometries are all in EPSG:32632!

In short, date, geom and source_id and classification_id are always present.

INFO

By default, the point geometry geom is returned as hex-encoded binary. To get the geometry as string, use the ST_AsText function. For example:

sql
SELECT id, date, ST_AsText(geom) AS wkt
FROM public.landslides
LIMIT 2;
iddatewkt
12024-11-01POINT(748676.21304 5272749.179051)
22024-10-22POINT(641802.697946 5196727.447737)

TIP

With the ST_AsEWKT function, the SRID can be included as well.

sql
SELECT id, ST_AsEWKT(geom) AS ewkt
FROM public.landslides
LIMIT 2;
iddatewkt
12024-11-01SRID=32632;POINT(748676.21304 5272749.179051)
22024-10-22SRID=32632;POINT(641802.697946 5196727.447737)

classification

This table stores the classification labels referenced by the landslides table (via classification_id). The available values are listed below:

name
rockfall
collapse, sinkhole
mass movement (undefined type)
gravity slide or flow
deep seated rock slope deformation

Each record is classified into one of these categories. The categories itself were derived from the GeoSphere data set (see Data Sources for more info).

Details

The corresponding query to the above table:

sql
SELECT name
FROM public.classification;

sources

The sources table stores metadata for each original data set referenced by landslides. It captures provenance, access details and licensing to ensure traceability and reproducibility. The id column is referenced by landslides.source_id.

FieldNullableDescription
nameNoSource name (data set title or institution)
downloadedNoDate the data set was retrieved
modifiedYesOptional: last modified date from the provider
licenseNoLicense type of the source
urlNoLink to the original data set or metadata page
descriptionYesOptional: Short, human‑readable summary of the data set
doiYesOptional: persistent identifier (DOI)

Views

landslides_view

For convenience, a view, called landslides_view, is available that encompasses information from all three tables (landslides, classification, sources). The view provides information on all mass movement phenomena in the data base including their source information and classification.

TIP

If you are looking for an entry point to the data base, use this view.

Retrieve everything with:

sql
SELECT *
FROM landslides_view;

INFO

As an optional (Docker) service a API is provided which could serve as an entry point for further applications. The API serves data from this landslides_view. See the Quick Start section for more details.


  1. See the Alembic tutorial ↩︎

Licensed under CC BY-SA 4.0