question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Plotly Express lines on maps

See original GitHub issue

Today, px.line_mapbox and px.line_geo expect rows which are points, which are then split into groups and connected by lines.

In most GIS formats, however, as wrapped by GeoPandas, the entire line feature is often stored in a single row, just like choropleth geometries. We should have either a new pair of PX functions for this (px.line_feature_mapbox?) or an option to the existing functions (px.line_mapbox(geojson=<geojson>)) to support this option out of the box.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
EsbernJakobsencommented, Oct 26, 2020

Just wanted to give this a bump!

Out-of-the-box support for shapely/GeoPandas LineStrings would be fantastic. I’m aware you’ve added some support for Shapely Points and Polygons. The GeoPandas support example given in Lines on Maps is useful but it doesn’t really exploit the strengths of pandas, as it involves unpacking the dataframe using a loop.

Thanks for all the work so far though! 🙂

2reactions
harisbalcommented, Oct 16, 2020

This will be a game changing enhancement since it will make plotly a viable alternative for representing geospatial data instead of GIS software. In addition I would like to suggest the following: People working with geospatial data are very used to be able to control the width, apart form the color of the line. I suppose this can be achieved already by iterating over each line and adjusting its width. However, straightforwardly providing this capability in px would be very useful. Cheers

Read more comments on GitHub >

github_iconTop Results From Across the Web

Lines on maps in Python - Plotly
Below we show how to create geographical line plots using either Plotly Express with px.line_geo function or the lower-level go.Scattergeo object.
Read more >
Plot Points and Lines on Map with Plotly + Mapbox - Medium
W hen you make map by yourself, we can easily imagine that the data points and lines are needed to understand where the...
Read more >
Interactive map using Geographical Information in Plotly Express
Interactive map using Geographical Information in Plotly Express. Visualizations are very powerful tools for any data science project.
Read more >
Creating Geographic Maps with plotly express - YouTube
Hello there! We will learn about creating Geographic or Choropleth Maps with plotly express. Choropleth means 'area' or 'region' in Greek.
Read more >
How to draw a line on Map in Python with Plotly - YouTube
How to draw a line on Mapbox maps using Scattermapbox traces and sets the mode attribute to a combination of markers and line....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found