Public
Edited
Jun 27, 2023
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function updateScores(featureCollection) {
featureCollection.features.forEach((feature) => {
const P_D = turf.length(turf.polygonToLine(feature)) * 1000;
const A_D = turf.area(feature);
feature.properties.score =
1 / (P_D / (2 * Math.PI * Math.sqrt(A_D / Math.PI)));
feature.properties.roundedScore = feature.properties.score.toFixed(2);
});
return featureCollection;
}
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