holtzy / The-Python-Graph-Gallery

A website displaying hundreds of charts made with Python
https://www.python-graph-gallery.com
BSD Zero Clause License
1.87k stars 370 forks source link

error in geoplot #369

Closed JosephBARBIERDARNAL closed 4 months ago

JosephBARBIERDARNAL commented 4 months ago

in https://python-graph-gallery.com/choropleth-map-geopandas-python/

import geopandas as gpd
import geoplot as gplt

# Load the json file with county coordinates
geoData = gpd.read_file('https://raw.githubusercontent.com/holtzy/The-Python-Graph-Gallery/master/static/data/US-counties.geojson')

# Make sure the "id" column is an integer
geoData.id = geoData.id.astype(str).astype(int)

# Remove Alaska, Hawaii and Puerto Rico.
stateToRemove = ['02', '15', '72']
geoData = geoData[~geoData.STATE.isin(stateToRemove)]

# Basic plot with just county outlines
gplt.polyplot(geoData, figsize=(20, 4))

leads to:

AttributeError: 'MultiPolygon' object has no attribute 'exterior'

JosephBARBIERDARNAL commented 4 months ago

this seems to be a projection related problem

JosephBARBIERDARNAL commented 4 months ago

this has been fixed in #380 , can close