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
Mapbox Cookbook

You're reading from  Mapbox Cookbook

Product type Book
Published in Mar 2016
Publisher
ISBN-13 9781784397357
Pages 264 pages
Edition 1st Edition
Languages

Table of Contents (13) Chapters

Adding a time dimension to your map


In this recipe, we will learn how to visualize data over time. For that purpose, we will use CartoDB and a plugin called Torque. As an example, we are going to plot the paths of airplanes as they depart from Miami International Airport.

How to do it…

The following steps need to be performed:

  1. First of all, we need to transform the data that we want to import into CartoDB to a format that is easy for the import tool to convert.

  2. Click on your dataset and import your data into CartoDB.

  3. Make sure that the imported data has a timestamp field and that it is correctly georeferenced.

  4. Link Torque to your project.

  5. Create a Torque CartoCSS style to stylize the markers generated by the plugin.

  6. Create a new torqueLayer and make sure that you pass the style, user account, and the table.

Torque is the Leaflet plugin we are going to use in order to plot our data over time. Imagine Torque data as a cube with the front side as a two-dimensional map, and the Z direction as the time...

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}