`contextily` is a small Python 3 package to retrieve and write to disk tile maps from the internet into geospatial raster files.
Questions tagged [contextily]
43 questions
0
votes
0 answers
Mistake in matching basemap through contextily
I am focusing on visualizing some datasets of Switzerland through 'contextily' package in python. (Here is just the sample. In fact, the whole dataset has 16000 records in Switzerland.)
Unnamed:…

Xiaoyan Lan
- 1
- 1
0
votes
0 answers
Account for more island land mass with contextily - python
I'm not sure if there is an answer for this so any alternative suggestions are appreciated. I'm aiming to account for more island land mass when plotting a baseman with contextily. I'm using matplotlib/contextily instead of Plotly because a scale…

Chopin
- 96
- 1
- 10
- 35
0
votes
1 answer
How to change the position of legend in a map?
I've been trying to plot a shapefile over a basemap. My issue here is the placement of the legend. I wanted it to be placed outside (next to) the map.
Specifically, I am plotting the "Ecoregion" column of the shapefile which basically labels each…

Kee C
- 5
- 4
0
votes
2 answers
Adding a basemap to a plot in Geopandas using X,Y coords
I am having trouble adding a basemap to my map. My geodataframe is created using X and Y coords of a bunch of points.
gdf = geo.GeoDataFrame(
df, geometry=gpd.points_from_xy(df['X'], df['Y']))
gdf.set_crs(epsg=3857)
Which look like this:
After…

RagingMonkey
- 19
- 3
0
votes
1 answer
Geopandas can't plot the right country
I'm trying to plot a trip on the map of France but I can't plot only the map of France (see image), could someone help me with this ?
I believe this may be an issue with the crs from the contextily library but I didn't find any information on the…

Achille G
- 748
- 6
- 19
0
votes
0 answers
matplotlib setting axis limits is not working
I am trying to specify figure limits in matplotlib, but they are not being enforced. I am setting the limits in my subplot, and I saw the figures were clearly at different extents, so I have printed out the specified and actual limits to confirm…

a11
- 3,122
- 4
- 27
- 66
0
votes
1 answer
Contextily basemap is blank with point GeoDataFrame
I have a dataframe of individual addresses with lat/long that I converted to a GeoPandas dataframe. I set the projection to the Contextily EPSG:3857 projection.
df = gpd.GeoDataFrame(df_vf,…

Adriana Rogers
- 5
- 1
- 3
0
votes
1 answer
Contextily add_basemap uses wrong extent and zoom level
I'm trying to add a contextily basemap to a Matplotlib figure containing a GeoPandas data frame. When I just plot the data frame using df.plot the map extent is calculated correctly.
However, when I try adding a contextily basemap the map extent…

tuesday
- 582
- 1
- 7
- 14
0
votes
1 answer
contextily making weird background maps
This is my code:
import pandas as pd
import geoplot as gplt
import geopandas as gpd
import geoplot.crs as gcrs
import contextily
df = pd.read_csv('dataframe_master.csv', index_col='id')
crs = {'init': 'epsg:4326'}
geometry = [geometry.Point(xy)…

Josie
- 3
- 1
0
votes
0 answers
How to generate map with geopandas and OpenStreetMaps in high resolution?
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'}…

trisnoo
- 1
0
votes
1 answer
How to switch between EPSG in Geopandas (Plotting and adding background map)
I am trying to draw some "station" coordinates on the NYC map. I use Geopandas(gpd) to create a GeoDataFrame and create a NYC map from gpd.datasets with EPSG of 4326.
In addition, I wanted to add a background image to my map following the Geopandas…

Maeror
- 93
- 2
- 11
0
votes
1 answer
How to configure urllib3 company proxy for contextily?
my end goal is to retrive a tile map using contextily and ploting (from this example):
import geopandas
import contextily as ctx
df = geopandas.read_file(geopandas.datasets.get_path('nybb'))
df = df.to_crs(epsg=3857)
ax = df.plot(figsize=(10, 10),…

Loris
- 1
-1
votes
2 answers
Annotate city names
I would like to annotate the city name Berlin at the coordinates xy=(52.52, 13.405). I've tried ax.annotate() which yields a strange map. Maybe it has to do with the CRS of the coordinates?
import geopandas as gpd
import contextily as ctx
world =…

Stücke
- 868
- 3
- 14
- 41