Working with maps in python using Mapbox and Plotly

Rahul Bhadani
Technology Hits
Published in
3 min readNov 12, 2020

--

photo by author

There are plenty of mapping services available dominated by Google Map, Here map, OpenStreetMaps, and a few lesser-known as such Mapbox. Of course, they all vary in features, services, and kind of use cases. For mapping applications that require precision and finer control, Google Map is the choice, but they are not convenient and free for all purposes. Some use-cases of Google MAP API are free but you probably need to enter credit card information for billing purposes to prevent any misuse. Recently, my research group started gathering GPS data from consumer cars and I was looking to overlay the GPS data on maps for further downstream analysis of GPS data. In the quest for a suitable python API, I stumbled upon plotly that uses various types of maps, with or without the need for an API key. plotly provides support Mapbox which is convenient to use.

Mapbox provides two sets of API token that can be used for querying mapping service: public and private. plotly uses a public API key to query mapping service from Mapbox. However, plotly doesn’t necessarily need an API token from Mapbox as it has a support mapping without API toke as well, but that won’t let you use Mapbox mapping tiles. I found out that API-token free mapping calls in plotly has poor map rendering. However, API token generation in Mapbox is so easy that there is no reason why we should not…

--

--

Rahul Bhadani
Technology Hits

Asst. Professor, @UAH | @uarizona PhD, ECE | Intelligent Transportation & Quantum Science Researcher | Donation: https://www.buymeacoffee.com/rahulbhadani