Check https://github.com/CartoDB/cartodb/wiki/CartoDB-Surrogate-Keys for latest developments.
This file contains 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
WITH deltas as ( | |
SELECT | |
st_distance(the_geom::geography, lag(the_geom::geography, 1) over(order by timestamp)) as ddist, | |
timestamp - lag(timestamp, 1) over(order by timestamp) as dt | |
from out_2 offset 1000 | |
) | |
select avg(ddist/dt) as speed from deltas |
This file contains 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 map = L.map('map', { | |
scrollWheelZoom: false, | |
center: [54.09806018306312, -3.80126953125], | |
zoom: 6 | |
}); | |
//var mapConfigEditor = CodeMirror.fromTextArea(document.getElementById('map_config_editor'), { | |
// theme: 'monokai', | |
// lineNumbers: true, | |
// mode: "javascript", |
This file contains 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
document.getElementById('map').style.height = window.innerHeight + 'px'; | |
var map = L.map('map', { | |
scrollWheelZoom: false, | |
center: [45, 0], | |
zoom: 3 | |
}); | |
L.tileLayer('http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', { | |
attribution: '<a href="http://cartodb.com">CartoDB</a> © 2014', |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>CartoDB + Leaflet interactivity example | CartoDB.js</title> | |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/> | |
<link rel="shortcut icon" href="http://cartodb.com/assets/favicon.ico" /> | |
<style> | |
html, body, #map { | |
height: 100%; |
This file contains 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 mapConfigEditor = CodeMirror.fromTextArea(document.getElementById('map_config_editor'), { | |
theme: 'monokai', | |
lineNumbers: true, | |
mode: "javascript", | |
height: "200px", | |
lineWrapping: true, | |
foldGutter: true, | |
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"] | |
}); |
This file contains 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 map = L.map('map', { | |
scrollWheelZoom: false, | |
center: [-18, -46], | |
zoom: 8 | |
}); | |
L.tileLayer('http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', { | |
attribution: '<a href="http://cartodb.com">CartoDB</a> © 2014', | |
maxZoom: 18 | |
}).addTo(map); |
This file contains 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
#!/usr/bin/python | |
import sys | |
import urllib | |
print urllib.unquote_plus(sys.stdin.read()) |
This file contains 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
#!/usr/bin/python | |
import sys | |
import urllib | |
print urllib.quote_plus(sys.stdin.read()) |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Leaflet multilayer example | CartoDB.js</title> | |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/> | |
<link rel="shortcut icon" href="http://cartodb.com/assets/favicon.ico" /> | |
<style> | |
html, body, #map { | |
height: 100%; |