Published
Edited
Sep 2, 2022
Importers
4 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
viewof modelSelection = Inputs.select(models, {
value: models[0],
label: "Geoid Dataset"
})
Insert cell
viewof cubic = Inputs.toggle({ label: "Cubic interpolation", value: false })
Insert cell
function geoidHeight(lat, lon, cubic = false) {
return geoid(modelSelection).then(
// This function is called when the dataset is loaded (a promise resolves).
function (calculate) {
// The parameter to this function is a function that takes a lat/long and provides a
// height using the loaded dataset.
return calculate(
lat, // latitude
lon, // longitude (be careful about the order of the arguments!)
cubic // true or false
);
}
);
}
Insert cell
height = geoidHeight(coordinates[1], coordinates[0], cubic) // Ensure lat and long order is handled correctly!
Insert cell
Insert cell
Insert cell
Insert cell
solutions = Promise.all(data.map((d) => geoidHeight(+d.latitude, +d.longitude)))
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more