Nat  Kutch

Nat Kutch

1594318080

How to create animated scatter maps with plotly and dash

Maps in Dash

Dash is a Python framework built on top of Flask and Plotly, designed to make data-driven web applications. Thanks to Plotly it provides some basic charts such as histograms and pie charts, and it also comes with a multitude of highly customizable controls such as dropdowns, checkbox, date sliders, and many more.

To build an app you can combine all of these controls and charts in one or more tabs. But when it comes to map drawing, it gets touchy. Plotly has some basic built-in maps plots: enough to show data, but not as nice as 2020 web maps should be. To tackle that weakness, Plotly made a partnership with Mapbox. Together they provide a great service.

Image for post

Example of Scatter map with default plotly maps (quite ugly)

Today we’ll see how to use Mapbox with Plotly within a dash application, and how to create animated scatter maps.

Image for post

Example of scatter map with Mapbox maps (very nice)

As this post is written in April 2020 during the coronavirus pandemic, I suggest working with Covid-19 Open Data to discover scatter maps.

Register to Mapbox

Some Mapbox representations require a token, and Scatter Maps is part of these. Don’t worry, this easy and free.

Go to www.mapbox.com and create an account. For this step, you only need an email for account verification. When it’s done you get your token on the “Tokens” page and clicking on the “Create a token” button.

With this token, you can draw 50000 maps/month for free. By the end of the article, we’ll see how to store maps and minimize the number of requests needed.

Image for post

Image for post

Screenshot from Mapbox’s website

It is common to store this information in a separate file from scripts. A usual way to do is using a *.ini file for storing, and then the python built-in configparser module for accessing it.

config.ini

[mapbox]
secret_token=your-token

any_file_needing_token.py

import configparser
config = configparser.read('config.ini')
mapbox_token = config['mapbox']['secret_token']

Create the Scatter Map

Loading data

As mentioned before, we’ll work with Covid pandemic data. We’ll use the dataset from Hopkins University which is updated on a daily basis during the crisis. It is available on opendatasoft.

Image for post

Head of the original dataset

Data are quite easy to understand: it contains daily information about covid in many countries, about either DeathConfirmed, or _Recovered _persons, with GPS information.

Processing data

This dataset has to be transformed to fit the Mapbox inputs. Let’s be clear about the input needed.

#data-visualisation #animation #data-science #data analysis

What is GEEK

Buddha Community

How to create animated scatter maps with plotly and dash
Nat  Kutch

Nat Kutch

1594318080

How to create animated scatter maps with plotly and dash

Maps in Dash

Dash is a Python framework built on top of Flask and Plotly, designed to make data-driven web applications. Thanks to Plotly it provides some basic charts such as histograms and pie charts, and it also comes with a multitude of highly customizable controls such as dropdowns, checkbox, date sliders, and many more.

To build an app you can combine all of these controls and charts in one or more tabs. But when it comes to map drawing, it gets touchy. Plotly has some basic built-in maps plots: enough to show data, but not as nice as 2020 web maps should be. To tackle that weakness, Plotly made a partnership with Mapbox. Together they provide a great service.

Image for post

Example of Scatter map with default plotly maps (quite ugly)

Today we’ll see how to use Mapbox with Plotly within a dash application, and how to create animated scatter maps.

Image for post

Example of scatter map with Mapbox maps (very nice)

As this post is written in April 2020 during the coronavirus pandemic, I suggest working with Covid-19 Open Data to discover scatter maps.

Register to Mapbox

Some Mapbox representations require a token, and Scatter Maps is part of these. Don’t worry, this easy and free.

Go to www.mapbox.com and create an account. For this step, you only need an email for account verification. When it’s done you get your token on the “Tokens” page and clicking on the “Create a token” button.

With this token, you can draw 50000 maps/month for free. By the end of the article, we’ll see how to store maps and minimize the number of requests needed.

Image for post

Image for post

Screenshot from Mapbox’s website

It is common to store this information in a separate file from scripts. A usual way to do is using a *.ini file for storing, and then the python built-in configparser module for accessing it.

config.ini

[mapbox]
secret_token=your-token

any_file_needing_token.py

import configparser
config = configparser.read('config.ini')
mapbox_token = config['mapbox']['secret_token']

Create the Scatter Map

Loading data

As mentioned before, we’ll work with Covid pandemic data. We’ll use the dataset from Hopkins University which is updated on a daily basis during the crisis. It is available on opendatasoft.

Image for post

Head of the original dataset

Data are quite easy to understand: it contains daily information about covid in many countries, about either DeathConfirmed, or _Recovered _persons, with GPS information.

Processing data

This dataset has to be transformed to fit the Mapbox inputs. Let’s be clear about the input needed.

#data-visualisation #animation #data-science #data analysis

Harry Patel

Harry Patel

1614145832

A Complete Process to Create an App in 2021

It’s 2021, everything is getting replaced by a technologically emerged ecosystem, and mobile apps are one of the best examples to convey this message.

Though bypassing times, the development structure of mobile app has also been changed, but if you still follow the same process to create a mobile app for your business, then you are losing a ton of opportunities by not giving top-notch mobile experience to your users, which your competitors are doing.

You are about to lose potential existing customers you have, so what’s the ideal solution to build a successful mobile app in 2021?

This article will discuss how to build a mobile app in 2021 to help out many small businesses, startups & entrepreneurs by simplifying the mobile app development process for their business.

The first thing is to EVALUATE your mobile app IDEA means how your mobile app will change your target audience’s life and why your mobile app only can be the solution to their problem.

Now you have proposed a solution to a specific audience group, now start to think about the mobile app functionalities, the features would be in it, and simple to understand user interface with impressive UI designs.

From designing to development, everything is covered at this point; now, focus on a prelaunch marketing plan to create hype for your mobile app’s targeted audience, which will help you score initial downloads.

Boom, you are about to cross a particular download to generate a specific revenue through your mobile app.

#create an app in 2021 #process to create an app in 2021 #a complete process to create an app in 2021 #complete process to create an app in 2021 #process to create an app #complete process to create an app

Ricky Martin

Ricky Martin

1596548536

How to Create Map Animations using Python

Python package that I will be using:

The Python package I would be using is Cartopy. It was initially developed at the UK Met office so that scientists could visualize their data accurately. Cartopy makes use of PROJ.4NumPy and Shapely libraries, and has an interface built on top of Matplotlib.

Sample Data

The sample data is COVID-19 data that has been downloaded from the following website. It contains the Latitude and Longitude data of every Country affected by COVID-19, along with the number of cumulative cases each day.

Preview of the Data

Image for post

This what the data looks like

Extracting Latitude and Longitude

We need to extract the list of latitude and longitude from the above data in such a way that the list is in order, starting from the Country, which showed the 1st COVID-19 case.

In the code given below, for every data column, we are iterating over all the rows, to check if the value for that particular row and column is ZERO or not. If the value is not equal to zero, the corresponding latitude and longitude get appended, thus ensuring the list of latitude and longitudes to be in the order of occurrence of COVID-19 for that particular Country. Since the same latitude and longitude would get appended numerous times, we change their value to 500 (to such a value that won’t be possible for latitude or longitude to possess) so that it is easier to remove them from the list later.

list_lat= []
list_long = []

for i in range(3, 193):
    for k in range(data.shape[0]):
        if(int(data.iloc[k, i]) != 0):
            list_lat.append(data.iloc[k, 1])
            list_long.append(data.iloc[k, 2])
#Change the already appended values to a different value
            data.iloc[k, 1] = 500 
            data.iloc[k, 2] = 500
        else:
            continue

list_lat[0:5] 
list_long[0:5]
#Removing the 500s from the list
#Latitude
for i in range(list_lat.count(500)):
    list_lat.remove(500)
#Longitude
for i in range(list_long.count(500)):
    list_long.remove(500)

Creating the Cartopy Map

#Installing Cartopy
pip install cartopy

#Importing required libraries
import cartopy
import cartopy.crs as ccrs
import cartopy.feature as cfeature
from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER
import matplotlib.pyplot as plt
import cartopy.mpl.geoaxes
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
from matplotlib.animation import FuncAnimation

#data #maps #animation #python

Hal  Sauer

Hal Sauer

1593060900

Create an Animated Choropleth Map with Less Than 15 Lines of Code

Table of Contents

Introduction

Choropleth maps

Data

Animated choropleth USA map

Animated choropleth world map

Conclusion

Introduction

Plotly Express makes it easy to create animated graphs. The official document says that “Although Plotly Express supports animation for many chart and map types, smooth inter-frame transitions are today only possible for scatter and bar.”

Even though choropleth maps are not mentioned, in this article you will find just how easy it is to create animated choropleth maps using Plotly and Python on Jupyter.

_This article assumes you are already familiar with the basic operation in JupyterLab/Jupyter Notebook and you have _[_Plotly installed]

Choropleth maps

choropleth map is a map composed of colored polygons. Plotly Express’ px.choropleth function and the lower-level go.Choropleth graph object can create choropleth maps and you can find some examples on the official website. You can only zoom in or out of the maps.

#animated-choropleth-map #data-visualization #plotly-express #jupyter #data-science

sarika Inogic

1623221809

Maplytics - Dynamics 365 CRM and Bing Maps Integration

Maplytics™ is an advanced mapping and data visualization tool for Microsoft Dynamics 365 CRM. It provides Territory Management, Appointment Planning, Routing, Radius Search and much more with support for PowerApps (CDS). Maplytics supports all Dynamics 365 deployment models for Dynamics CRM 2011 and above as well as native Dynamics 365 App for Phones and Tablets.
Below are the features you can avail with Maplytics
• Sales Territory Management: Geographically manage and align sales territories, perform binary operations on shapes, regions or territories on map. Assign multiple territories to a record.
• Auto Scheduling: Create an automated optimized schedule for multiple days on field including routes to follow each day based on details entered by user and also create activities for the same
• Check-In/Check-Out: Enable Check-In/Check-Out for field reps on site of visit with the option of Geofencing
• PCF control: User can add components on fields or grids within Dynamics CRM to view the respective records on the map within the record form or the entity grid
• Overlay: View records, shape files and existing territories together on map. View Census Data as existing Overlay feature.
• Proximity Search: Search records for a location based on radius or time with shortest travel and line of sight distance.
• Route Optimization: Optimize routes, find nearby records along the route and points of interest like Coffee Shops, Gas station, etc.
• Customizable Pushpins & Tooltip Cards: Plot desired icons for pushpins for seamless visual analysis. Call to action buttons on Tooltip cards for quick actions.
• Security template: System admin and Maplytics admin can provide selective access of actions to users
• Marketing Management: Create geographically targeted Marketing Lists for personalized and relevant promotions, marketing campaigns and events
• Mass Actions: Add to Route, Save Data, Schedule Appointments, Send Emails and more for records plotted on map
• Summary Card: Get aggregated information for enclosed area on map for quick analysis
• Layer Menu/Download Map: Show/hide layers plotted on map to toggle between them and Download the map as image visible on screen
• Mobility: Use native Dynamics 365 App for Phones and Tablets to get locational insights
• Heat Map Visualization: Analyze density of CRM data on map for insights through pie/column charts
• Real-Time Tracking: Managers can now track the location of Field Service Reps when on field in real time within Dynamics 365 Field service.
• Land Area Mapping: Define the area of land as agricultural, residential, commercial properties and visualize the same on the map.
• Territory Assignment Rule: Maplytics Admins and Managers can create simple/advanced rules based on which territories will be assigned to the records as per the required conditions.

#maps #bing #maps #map #dyynamics #65crm