0

I would like to generate a high resolution maps in python using following:

catnetDATA = os.path.join('data', 'CATNET10k.csv')
df = pd.read_csv(catnetDATA)

geometry = [Point(xy) for xy in zip(df.LONGITUDE, df.LATITUDE)]
crs = {'init': 'epsg:3857'} 
geo_df = GeoDataFrame(df, crs=crs, geometry=geometry)
geo_df.to_file(driver='ESRI Shapefile', filename='data.shp')

geo_df = geo_df.to_crs(epsg=3857)

In this code:

ax = geo_df.plot(column='WILDFIRE',figsize=(20,20), alpha=1, legend=True, cmap='YlOrRd', scheme='user_defined',
legend_kwds={'title': "Wildfire risk"}, classification_kwds={'bins':[0,1,2,3,4,5,6,7,8]})
ax.set_axis_off()
ctx.add_basemap(ax, crs='epsg:4326', source=ctx.sources.OSM_A)

the result looks almost good. Only the OSM map resolution is too low: map1

after adding zoom=3 to function below:

ctx.add_basemap(ax, zoom=3, crs='epsg:4326', source=ctx.sources.OSM_A)

map2

In map2 it looks bad. The resolution has not increased. How to generate map with geopandas and OpenStreetMaps in high resolution?

swatchai
  • 17,400
  • 3
  • 39
  • 58

0 Answers0