<commit_before>---
template: example.html
title: turf-isolines
description: Takes a FeatureCollection of points with z values and an array of value breaks and generates isolines. These are commonly used to create elevation maps, but can be used for general data interpolation as well.
tags:
    - interpolation
---
<div id='map'></div>

<script>
L.mapbox.accessToken = '<KEY>';

var map = L.mapbox.map('map', 'morganherlocker.kgidd73k')
    .setView([39.236242036607756,-106.80770874023438], 11);

var points_layer = L.mapbox.featureLayer().loadURL('{{site.baseurl}}/assets/js/elevation.json');
points_layer.on('ready', function () {
    var resolution = 30;
    var breaks = [500,2000,4000,5000,6000,8000,9000,10000,11000,12000,15000];
    var isolines = turf.isolines(points_layer.toGeoJSON(), 'elevation', resolution, breaks);
    isolines.features.forEach(function (feature) {
        feature.properties["stroke"] = "#25561F";
        feature.properties["stroke-width"] = 2;
        feature.properties["stroke-opacity"] = .5;
    });

    L.mapbox.featureLayer().setGeoJSON(isolines).addTo(map);
});
</script><commit_msg>removed jekyll templte to fix json location<commit_after>---
template: example.html
title: turf-isolines
description: Takes a FeatureCollection of points with z values and an array of value breaks and generates isolines. These are commonly used to create elevation maps, but can be used for general data interpolation as well.
tags:
    - interpolation
---
<div id='map'></div>

<script>
L.mapbox.accessToken = '<KEY>';

var map = L.mapbox.map('map', 'morganherlocker.kgidd73k')
    .setView([39.236242036607756,-106.80770874023438], 11);

var points_layer = L.mapbox.featureLayer().loadURL('/assets/js/elevation.json');
points_layer.on('ready', function () {
    var resolution = 30;
    var breaks = [500,2000,4000,5000,6000,8000,9000,10000,11000,12000,15000];
    var isolines = turf.isolines(points_layer.toGeoJSON(), 'elevation', resolution, breaks);
    isolines.features.forEach(function (feature) {
        feature.properties["stroke"] = "#25561F";
        feature.properties["stroke-width"] = 2;
        feature.properties["stroke-opacity"] = .5;
    });

    L.mapbox.featureLayer().setGeoJSON(isolines).addTo(map);
});
</script>
{'fraction_non_alphanumeric': 0.14708480565371024, 'fraction_numerical': 0.08303886925795052, 'mean_word_length': 4.551470588235294, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7466897', 'n_tokens_mistral': 854, 'n_tokens_neox': 710, 'n_words': 167}