aboutsummaryrefslogtreecommitdiff
path: root/visualizer/extractor/destinations.py
diff options
context:
space:
mode:
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)')