Encode

Work

Camera-based river flow measurement platform

One algorithm in five runtimes, in production since January 2016, more than 17 million measurements by October 2026.

One platform, in production since January 2016, built around photrack AG's camera-based measurement and its C++ algorithm. More than 17 million measurements from sites in 98 countries and territories, October 2026.

Discharge platform: one engine in five runtimes Edge Platform Serverless Phone app iOS + Android, Flutter Engine DischargeKeeper fixed station Engine Earlier Android app Engine Browser hydrologists, operators Web application React REST API Django Engine PostgreSQL Object storage video, images Video processing Engine Exports WaterML 2.0, ZRXP, CSV Alarms e-mail Maintenance Other systems WaterML 2.0, ZRXP Upload Orange: the client's C++ engine, unchanged in five runtimes.
Discharge platform: one engine in five runtimes

Situation

Measuring how much water flows in a river has meant equipment in the water, experts on site and regular maintenance. Equipment gets damaged, and measuring during a flood is hard and dangerous, exactly when the data matters most. photrack AG in Zürich developed non-contact measurement from video, taken with a phone, a fixed camera or a drone, with its own C++ algorithm behind it. What it needed was the software around that algorithm: a cloud platform, a web application, an API, mobile apps, cloud processing, infrastructure and operations.

What we built

Since January 2016 we have built and run the Discharge platform as photrack's development partner, on a yearly roadmap, responsible for the whole platform and its infrastructure. One Django REST API of about 60 endpoints (October 2024) serves the web application, both mobile apps, the DischargeKeeper field stations and the serverless jobs. Heavy work runs in four AWS Lambda functions triggered by each upload: video processing, exports, alarms and maintenance.

The platform grew from an MVP into a multi-product system: a web platform with a REST API, cloud video processing, two generations of mobile app (Android in 2018, Flutter for iOS and Android in 2026) and the integration of autonomous DischargeKeeper stations. It widened from flow measurement to water quality and meteorology, and it now serves hydrological services, hydropower and irrigation operators, utilities, researchers and citizen-science networks in 98 countries and territories, with an interface in 8 languages. Rating curves, alarms, hardware telemetry, remote station configuration, WaterML 2.0 and ZRXP exports and a KPI dashboard complete it.

The platform was also rebuilt in place over the years. AngularJS gave way to React and TypeScript. Python was upgraded, a new CI/CD pipeline and a new export system were introduced, the plans were simplified. All of it happened while stations around the world kept sending data.

The measurements page of the Discharge web application: a chart of three discharge series, mean surface velocity, bulk velocity and wet cross-sectional area for one DischargeKeeper station from 23 to 25 September 2026, with the table of measurements, the validation and the export buttons below it.
The web application's measurements page: one DischargeKeeper station over three days in September 2026, with its table of measurements, validation and export below the chart.

The hard part

photrack's algorithm has to give the same result wherever a measurement is processed. It runs unchanged in five places: the first Android app through JNI, the Flutter app through Dart FFI, the DischargeKeeper station, the web server and AWS Lambda, with one JSON contract between them. A measurement taken on a phone and reprocessed in the cloud is comparable with one computed at a station.

The 2026 mobile app was the latest test of that rule. We cross-compiled the engine and its dependencies for ARM on iOS and Android, wrapped 7 C functions with Dart FFI behind the same JSON contract, and retired an Android-only JNI layer. The phone processes video offline and hands the measurement to the web through a short code for precise reprocessing. Mobile results were validated against the reference desktop computation within 1 percent for scalar values. Recalculating at the real water depth takes seconds on the phone, because the computed velocity field is reused instead of recomputed.

Outcome

  • More than 17 million measurements, over 6,600 users, over 1,600 organisations and over 2,200 measurement sites (October 2026).
  • Measurement sites in 98 countries and territories, 47 of them with 10 or more sites and 30 with 1,000 or more measurements (29 October 2026). The largest by measurements are Germany and Switzerland, each above 4.8 million, then the Republic of Korea above 3.3 million.
  • 110 fixed stations active and sending data (KPI dashboard, 2 September 2026).
  • Continuous development since January 2016, several thousand commits.
  • Single-station datasets of almost 500,000 measurements are handled. Large exports run asynchronously.
  • A capacity analysis showed room for user growth without more expensive infrastructure.
  • First iOS release of the measurement app in 2026.

What changed:

  • The platform moved from AngularJS to React, through Python upgrades, a new CI/CD pipeline and a new export system, without interrupting stations reporting worldwide.
  • The 2026 app brought measurement to iOS for the first time, with the same engine on five runtimes.
  • Video processing runs as serverless jobs triggered by each upload rather than on a fixed server.
  • API uptime of 99.9 percent over the last two years (29 October 2026).
The rating curve view of the Discharge web application: one station's measurements plotted as water level against discharge, with the rating curve of 10 January 2023 drawn through them.
One station's rating curve in the web application: every measurement as water level against discharge, with the curve of 10 January 2023 drawn through them.

In their words

Encode has proven to be the ideal partner to implement and evolve our ideas into a very solid and scalable system. We're building discharge.ch together.

Fact sheet

Clientphotrack AG, Zürich, Switzerland. Product: Discharge, discharge.ch.
Engagementlong-term development partner since 2016. Yearly roadmap, iterative delivery, Encode responsible for the whole platform and infrastructure.
In production sinceJanuary 2016.
How we work togethertwo in-person meetings a year, a roadmap in January and an alignment after summer. A weekly sync with the client's product lead, a weekly deep-dive, a Kanban board with an acceptance stage reviewed by the client.
PlatformDjango and Django REST Framework on AWS (EC2 with Docker and NGINX, RDS PostgreSQL, S3, Lambda, CloudWatch, Secrets Manager). React 18 and TypeScript web application with 15 dynamic pages. Flutter app for iOS and Android with the C++ engine through Dart FFI. CI/CD on GitHub Actions, Sentry, Playwright.
DevicesDischargeKeeper autonomous field stations, with alarms, hardware telemetry, remote configuration and device registration.
StandardsWaterML 2.0 (OGC) and ZRXP exports.
Numbers, with their dates17,469,552 measurements and sites in 98 countries and territories (29 October 2026). 6,691 users, 1,681 organisations, 2,285 sites (public stats endpoint, 22 October 2026). 110 stations active (2 September 2026). API uptime 99.9 percent over the last two years. 8 interface languages. Refreshed on publication day.
CompanyEncode d.o.o., Zagrebačka cesta 145A, Zagreb, Croatia
info@encode.hr
SiteWork Services About Contact
LegalImpressum / Legal notice Privacy
OIB 04954819540, MBS 060325736