๐ง๏ธ Cropped precision
Each polygon is pre-clipped to the exact circular area you queried โ no post-processing needed on your side.
โก Binary-efficient
Protobuf encoding cuts payload size significantly compared to JSON, making it ideal for mobile and embedded clients.
๐บ๏ธ GeoJSON-ready
Two decode steps are all it takes to go from raw bytes to shapes you can drop straight into geojson.io or Mapbox.
What the endpoint returns
POST /v1/precipitations/geometry responds with a raw binary body (Content-Type: application/x-protobuf).
The bytes encode a PrecipitationFeatureCollection message โ a list of PrecipitationFeature items, each carrying a cropped MultiPolygon geometry and typed precipitation properties.
Data source & update cadence ๐ก
Precipitation data is produced by the iklim.co precipitation service from radar observations.- Cadence: a new radar observation is processed every 10 minutes.
radarTimestampvalues of new records are aligned to a 10-minute UTC grid (e.g.12:00,12:10,12:20). - Observation + forecast frames: each radar snapshot produces an observation (
forecast: false) and forecast polygons at the configured offsets after the snapshot, up to the configured forecast horizon (forecast: true). TheradarTimestampof a forecast record is the time the forecast is valid for, so it lies in the future: setendTimeEpochin the future (up to the forecast horizon) to retrieve forecast records. - Forecast records are short-lived: a forecast record is deleted once its valid time is reached; the radar observation for that time then arrives as a regular
forecast: falserecord. Request the geometry of a forecast record before its valid time. - Retention: records are kept for 30 days.
Proto schema ๐
Below are the proto message definitions used by iklim.co for this endpoint.Decoding & converting to GeoJSON ๐ ๏ธ
Why two steps? GeoJSON is a JSON text format (RFC 7946) โ it has no official protobuf schema. Its coordinates are bare nested arrays (
[[lng, lat], ...]), which protobuf cannot represent without a named wrapper message. iklim.coโs binary schema uses typed messages (Coordinate, Ring, PolygonShape, โฆ) optimised for compact encoding, so a structural reshaping step is always required after decoding.- Step-by-step guide ๐ช
- All-in-one snippet โก
- GeoJSON output ๐
1
Install protobufjs ๐ฆ
2
Fetch the binary response ๐
Tell
fetch to read the response as an ArrayBuffer, then wrap it in a Uint8Array for the proto decoder.3
Decode the protobuf bytes ๐
Load At this point
geojson.proto and decode the bytes into a JavaScript object.fc looks like:4
Convert to standard GeoJSON ๐บ๏ธ
Transform the decoded object into RFC 7946-compliant GeoJSON.
Field reference ๐
PrecipitationFeature
geometry (MultiPolygon)
properties
Precipitation type (
precipType) is returned in the protobuf properties (field precip_type = 4) and, as an optional field (RAIN or SNOW), on the JSON records of POST /v1/precipitations/within and POST /v1/precipitations/page. Records with a known type carry RAIN or SNOW; older records without a type carry PRECIP_TYPE_UNSPECIFIED in the protobuf and omit the field in JSON. It is additive: clients built with an older geojson.proto skip the new field and are not affected.IntensityType catalog
Intensity classes are defined by radar reflectivity (dBZ). Rain and snow use separate bands. Reflectivity below 5 dBZ is treated as no precipitation and produces no polygon.
The dBZ bands above are the current thresholds. They may be tuned; any change will be announced in the release notes.