Created
February 26, 2013 16:06
-
-
Save yaph/5039629 to your computer and use it in GitHub Desktop.
Get info in Berlin bike routes from http://www.stadtentwicklung.berlin.de/verkehr/mobil/fahrrad/radrouten/de/gps_tracks/index.shtml used on this map http://exploringdata.github.com/vis/berlin-bike-routes/
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
var routes = []; | |
var route = {}; | |
$('.datenhellgrau td').each(function(idx, item){ | |
if ('sp1_1' == $(item).attr('headers')) { | |
route = {}; | |
route['name'] = $(item).text(); | |
} | |
else if ('sp1_2' == $(item).attr('headers')) { | |
route['gpx'] = $($(item).find('.download a')[0]).attr('href') | |
.replace('../../download/gps_tracks/', '/gpx/'); | |
routes.push(route); | |
} | |
}); | |
JSON.stringify(routes); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment