Skip to content

[REQUEST] Add Thailand #103

@thiagovmdon

Description

@thiagovmdon

Data source
Thailand data is available from the official public ThaiWater platform.

Main references:

Terms of use / provider references:

The backend responds anonymously with JSON through the public api-v3.thaiwater.net endpoints.

Type of data portal
This portal provides public API access.

For the first implementation, the most useful endpoints are:

  • waterlevel_load for station metadata / current snapshot
  • waterlevel_graph for time series

No registration appears to be required for these public endpoints.

The flow / flow_graph endpoints also exist, but they appear to be much narrower and likely Bangkok-focused, so they are probably not the best basis for the first Thailand fetcher.

Country/Countries/Regions
Thailand

The public waterlevel_load endpoint currently exposes about 731 tele_waterlevel stations across 76 provinces and 4 agencies.

Variables
Based on current source behavior, the following variables look suitable for the first implementation:

  • daily discharge
  • instantaneous discharge
  • daily stage
  • instantaneous stage

Important source notes:

  • the live stage field in metadata appears to be mainly waterlevel_msl
  • waterlevel_m appears mostly null in current metadata
  • waterlevel_graph.data.graph_data[].value appears to be the usable stage time series field
  • discharge is only available for a subset of stations
  • around 205 current stations expose non-null discharge in the live metadata feed

For v1, I would suggest supporting:

  • constants.STAGE_DAILY_MEAN
  • constants.STAGE_INSTANT
  • constants.DISCHARGE_DAILY_MEAN
  • constants.DISCHARGE_INSTANT

The implementation should explicitly document the current assumption that graph value corresponds to stage relative to MSL, because that inference is based on observed live payloads.

Station list
Yes, station metadata is available from:

Useful station metadata fields include:

  • station id
  • station old code
  • station name
  • latitude
  • longitude
  • river name
  • basin name
  • province / district / subdistrict
  • agency
  • station type

A cached station CSV can be built from waterlevel_load.

Code snippets
Code under the branch thailand

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions