Fixing Sarkoa's map URLs so shared links actually work for everyone.

Project date Web maps · Geospatial analysis

A link is a little note that tells the browser what to show. Anything written in the note travels with it to whoever opens it. Engineers call the stuff in the note state. A shared map link carries two totally different kinds of state, and it’s surprisingly easy to mix them up.

If I draw a polygon on a field and send you a 30-day NDVI chart (NDVI is a greenness score worked out from satellite imagery: near 0 for bare soil, close to 1 for lush crops), that exact shape and date range are the whole point of the link. The fact that my UI menus happen to be in English is just my personal preference - forcing my language on someone in Montreal or Tokyo because they clicked my link is just bad UX.

Sarkoa’s map addresses used to start with a locale prefix - the /en-CA/ or /en-GB/ bit that says which language the page is in. So I stripped the locale prefix out of Sarkoa’s map URLs. Old prefixed links still redirect cleanly, and menus now follow the viewer’s own account language or browser settings instead of whoever copied the URL.

On the flip side, analytical state has to travel with the link. To test it, I drew a small (~3 ha) triangle on our synthetic Saskatchewan farm and shared 30 days of its NDVI curve. Even nudging one corner a few metres pulls different 10 m pixels into the average, so whoever opens the link needs to land on that exact triangle.

Open the embed above and the triangle, date range, and chart are already restored (switch to Table to inspect individual dates, or open the same chart full screen). Both the encoded geometry and the date window live in the URL fragment - everything after the #. The fragment is the one part of an address the browser keeps to itself: it is never sent to the server when the page is requested (RFC 3986); once the viewer loads, it unpacks the fragment and asks Sarkoa for the raster stats.

All posts