Avatar

mxdvl

Digital toolmaker Currently client-side @guardian
Joined March 5, 2023
Public vals
5
mxdvl avatar
mxdvl
trips
Script
Turn an array of coordinates in the format [longitude, latitude] into an array of GeoJSON features as line strings. An optional distance threshold between subsequent points decides when distinct trips are created. Defaults to 120m. Example on Observable
0
mxdvl avatar
mxdvl
round
Script
Round numbers with arbitrary decimal precision
0
mxdvl avatar
mxdvl
cities
HTTP
Retrieve a city for a given coordinates in the format [longitude, latitude] . An OPENCAGE_API_KEY variable is necessary and can be obtained for free on their website .
0
mxdvl avatar
mxdvl
haversine_distance
Script
Implementation of the Haversine formula for calculating the great circle distance between two points on a sphere. If no radius is provided, the average Earth’s radius is used with a value of 6371km.
0
Next