Geospatial
Interactive

Connection Map

Connection maps (also called flow maps or route maps) display relationships and movements between geographic locations using lines or arcs. They're commonly used to visualize flight routes, trade flows, migration patterns, and communication networks. Great circle paths can be used to show the shortest distance between points on a globe, creating visually appealing curved routes that accurately represent real-world paths.

Interactive Visualization

Loading interactive chart...

This is an interactive connection map. You can zoom, pan, and hover over elements for details.

Try this prompt

"Use Folium to create an interactive connection map showing 'Flight Routes' from 'New York' to other major cities. Generate a proper example dataset to demonstrate this visualization."
Generate this now

Python Code Example

example.py
import pandas as pd
import numpy as np
import plotly.graph_objects as go

# Define New York as Hub (Origin)
origin = {"City": "New York (JFK)", "Lat": 40.6413, "Lon": -73.7781}

# Destinations with passenger data
destinations = [
    {"City": "London (LHR)", "Lat": 51.4700, "Lon": -0.4543, "Passengers": 2500},
    {"City": "Tokyo (HND)", "Lat": 35.5494, "Lon": 139.7798, "Passengers": 1800},
    {"City": "Los Angeles (LAX)", "Lat": 33.9416, "Lon": -118.4085, "Passengers": 3200},
    {"City": "Paris (CDG)", "Lat": 49.0097, "Lon": 2.5479, "Passengers": 2100},
    {"City": "Dubai (DXB)", "Lat": 25.2532, "Lon": 55.3657, "Passengers": 1500}
]

df = pd.DataFrame(destinations)

# Create Plotly figure with routes
fig = go.Figure()

# Add origin marker
fig.add_trace(go.Scattermapbox(
    lat=[origin["Lat"]], lon=[origin["Lon"]],
    mode='markers',
    marker=dict(size=14, color='black'),
    name='HUB: New York (JFK)'
))

# Add destination markers and routes
for _, row in df.iterrows():
    fig.add_trace(go.Scattermapbox(
        lat=[origin["Lat"], row['Lat']],
        lon=[origin["Lon"], row['Lon']],
        mode='lines',
        line=dict(color="#ff7800", width=2),
        name=f"NYC -> {row['City']}"
    ))

fig.update_layout(mapbox_style="carto-positron", mapbox_zoom=1)
fig.show()

Common Use Cases

  • 1Airline route network visualization
  • 2Trade flow between countries
  • 3Migration pattern analysis
  • 4Supply chain and logistics mapping

Pro Tips

Use great circle paths for accurate long-distance routes

Vary line thickness based on flow volume

Add animation for directional flows