Last active
March 6, 2017 19:14
-
-
Save benheb/42281cf939e451b4c5cfa000272b593a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// "lo1":0.0, | |
// "la1":90.0, | |
// "lo2":359.75003, | |
// "la2":-90.0, | |
// "dx":0.25, | |
// "dy":0.25 | |
var features = []; | |
var lat = 90; | |
var lon = 0; | |
_.each(data, function(d, i) { | |
//just to keep it small ish, only add when in lat range | |
if ( lat < 48 && lat > 25) { | |
var obj = {}; | |
obj.type = 'Feature'; | |
obj.properties = {'value': Math.round(9/5*(d - 273) + 32)}; | |
obj.geometry = {}; | |
obj.geometry.type = "Point"; | |
obj.geometry.coordinates = [lon, lat]; | |
features.push(obj); | |
} | |
//each point iterate lon 0.25 deg | |
lon = lon+0.25; | |
//at -180, start over | |
if ( lon > 180 ) { | |
lon = -180; | |
} | |
//at 0 step down lat | |
if ( lon === 0 ) { | |
lat = lat - 0.25; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment