aboutsummaryrefslogtreecommitdiff
path: root/visualizer/extractor/destinations.py
diff options
context:
space:
mode:
authorÉtienne Simon <esimon@esimon.eu>2015-05-11 20:00:04 -0400
committerÉtienne Simon <esimon@esimon.eu>2015-05-11 20:00:04 -0400
commit1eca8867751df644a62752fbbfbc6a6de849de74 (patch)
treeb0ba7e868a38e3e18c2e6c0eb5626cec035c0e5b /visualizer/extractor/destinations.py
parentbfda3532ea58a48533ceaa417b1bd5c3f5137be3 (diff)
downloadtaxi-1eca8867751df644a62752fbbfbc6a6de849de74.tar.gz
taxi-1eca8867751df644a62752fbbfbc6a6de849de74.zip
Add visualizer.
Lasciate ogni speranza voi ch'entrate: I am the bone of my javascript DOM is my body and JQuery is my blood I have created over a thousand lines Unknown to death Nor known to life Have withstood pain to create many functions Yet those hands shall never type anything So, as I pray, Unlimited Openlayers Works
Diffstat (limited to 'visualizer/extractor/destinations.py')
-rwxr-xr-xvisualizer/extractor/destinations.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/visualizer/extractor/destinations.py b/visualizer/extractor/destinations.py
new file mode 100755
index 0000000..967e766
--- /dev/null
+++ b/visualizer/extractor/destinations.py
@@ -0,0 +1,19 @@
+#!/usr/bin/env python
+
+from data.hdf5 import taxi_it
+from visualizer import Vlist, Point
+
+
+_sample_size = 5000
+
+if __name__ == '__main__':
+ points = Vlist(cluster=True)
+ for line in taxi_it('train'):
+ if len(line['latitude'])>0:
+ points.append(Point(line['latitude'][-1], line['longitude'][-1]))
+ if len(points) >= _sample_size:
+ break
+ points.save('destinations (cluster)')
+ points.cluster = False
+ points.heatmap = True
+ points.save('destinations (heatmap)')