Serverless GeoAI: the architecture

Three CoffeeMap.dev projects · no VPS · no database · no Python at runtime

A · LIVE IN THE BROWSERBlue Nile · Riyadh Urban Heat B · PRECOMPUTE ONCEGeoAI Crop Monitoring, Al Jouf C · TRAINED MODELSTrain offline, infer in browserNEXT PUBLIC DATA Planetary ComputerS1, S2, Landsat,WorldCover · keyless Sentinel Hub / CDSEProcess API with thevisitor's own token Terrain tilesAWS Terrarium,MapTiler Terrain-RGB Weather APIsOpen-Meteo,NASA POWER OpenStreetMapOverpass + bundledsnapshot fallback 1Band math on tile serverdB, °C and NDVI upstream,sent as byte-encoded PNGs 2Exact decodecreateImageBitmap with nocolour or alpha changes 3Tile grid = analysis gridWeb Mercator typed arrays,1.2–1.6 million cells 4Analysis on the devicedistance transforms, blurs,k-means, TensorFlow.js GPU 1STAC + Rasterio readsonly the Al Jouf window,never the whole scene 2NumPy: indices & seriesNDVI, EVI, masks, composite,bincount per field 3OpenCV: find the fieldsHough circles for pivots,contours for block fields 4Static JSON + live tilesfields.geojson + timeseries+ live tiles for any date 1Train offlineU-Net and LightGBM on openand hand-labelled data 2Export to ONNXquantised to a few MB(int8 or fp16) 3Model as a static fileserved like any other assetfrom shared hosting 4Inference in the browserONNX Runtime Web, WebGPUwith a WebAssembly fallback Static hostingNext.js static export on shared hosting: HTML, JS, JSON, snapshots and ONNX models. No VPS, no database, no tile server. The visitor's browserMapLibre GL, Chart.js, MUI. Results are painted to a canvas and overlaid on the map, aligned to the grid.
Live and runningPlanned: Route CClick any box for details

Rule of thumb: if it depends on the visitor's settings, compute it in the browser. If it is the same for everyone, compute it once and ship it as a file.

Amin Adnan Gasim · coffeemap.dev