Reputation: 29
I'm fairly new to Python, so sorry if there's a simple thing I'm missing. I've tried to troubleshoot ):
I'm trying to add basemap to geopandas, here is the code:
dropoff = gpd.GeoDataFrame(dataset, geometry=gpd.points_from_xy(dataset["dropoff_lon"],dataset["dropoff_lat"]))
dropoff = dropoff.set_crs(epsg=3857, allow_override=True)
ax = dropoff.plot(figsize = (10,10))
ctx.add_basemap(ax, zoom = 0)
the image keeps showing as this, it's supposed to display a map of NYC in the background:
Upvotes: 0
Views: 821
Reputation: 29
I figure out the answer.
crs needed to be referenced in the basemap. Like this:
ctx.add_basemap(ax, crs='EPSG:4326', zoom = 15)
Upvotes: 1