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.

Add Geopandas support

See original GitHub issue

Hi,

Thanks for your amazing work, many custom function can now been deprecated and lots of keystroke are saved. If I may have a feature request it would be to support geopandas API for the geo plots.

If you are not familiar with this library, it inherits pd.DataFrame and embedd a custom geometry column that stores the geo object (Points, Polygone, Line …). It would be great if the plots could be done based on the geometry automatically, without casting points, or specifing the that you want polygons…

Tell me if you want more details about this.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:13
  • Comments:43 (20 by maintainers)

github_iconTop GitHub Comments

10reactions
emigre459commented, Dec 6, 2019

As this is still marked as open I wanted to give it a bump - geopandas support via plotly express would be amazing!

6reactions
nicolaskruchtencommented, Oct 14, 2020

Here’s a complete/simple example (edited to remove the unnecessary .__geo_interface__ I’d left in for testing 😃

import numpy as np
import geopandas as gpd
import plotly.express as px

#  GeoJson from French Open-Data (french department)
url = "https://www.data.gouv.fr/fr/datasets/r/90b9341a-e1f7-4d75-a73c-bbc010c7feeb"

# Read file with geopandas
geo_df = gpd.read_file(url)
geo_df['random_color'] = np.random.randint(1, 6, geo_df.shape[0])
fig = px.choropleth_mapbox(geo_df, 
                           geojson=geo_df.geometry, 
                           locations=geo_df.index, 
                           color='random_color',
                           center={"lat": 48.8534, "lon": 2.3488},
                           mapbox_style="open-street-map",
                           zoom=4)
fig.show()

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Installation — GeoPandas 0.12.2+0.gefcb367.dirty ...
To install GeoPandas and all its dependencies, we recommend to use the conda package manager. This can be obtained by installing the Anaconda...
Read more >
Fastest way to install Geopandas in jupyter notebook on ...
First way- Using Anaconda Navigator. Open Anaconda Navigator,go to Environments section then select the environment,in our case geo_env. Then click on “play” ...
Read more >
Geopandas Installation— the easy way for Windows!
Check that GeoPandas has installed properly and explore by importing it and viewing the help option on the module. Note: If the following...
Read more >
geopandas - PyPI
GeoPandas is a project to add support for geographic data to pandas objects. The goal of GeoPandas is to make working with geospatial...
Read more >
Install Geopandas for Python with Anaconda - YouTube
This tutorial will get you started with Python programming for GIS by installing Anaconda, Geopandas, and a number of other geospatial ...
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