Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Learning Hunk

You're reading from  Learning Hunk

Product type Book
Published in Dec 2015
Publisher
ISBN-13 9781782174820
Pages 156 pages
Edition 1st Edition
Languages
Authors (2):
Dmitry Anoshin Dmitry Anoshin
Profile icon Dmitry Anoshin
Sergey Sheypak Sergey Sheypak
Profile icon Sergey Sheypak
View More author details

Implementation


Now it's time to implement heatmap application. We will start from creating query to get sample data for application and then move forward to coding visualization using Javascript and Python.

Querying the visualization

Let us start to get acquainted with the data we have. We are going to explore sample data to make the process faster.

We are going to use the next query during development. We will display a heatmap for the center of Milano. The other simplification is a hardcoded time interval. We removed all other intervals from the sample dataset using the Pig script earlier. The general idea is to reduce the amount of data and make the development cycle shorter:

(index="milano_cdr_sample" time_interval=1385884800000 
AND (
 (square_id >5540 AND square_id < 5560) OR 
 (square_id >5640 AND square_id < 5660) OR 
 (square_id >5740 AND square_id < 5760) 
 )
)

| fields square_id, sms_in, time_interval 

| stats sum(sms_in) as cdrActivityValue by square_id, time_interval...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}