Differences in projecting satellite images with cartopy and pyresample

I have written a python script to project and overlay geostationary satellite images from the university of Dundee so the resulting image can be used for xplanet to render the surface of the...

How can I show a km ruler on a cartopy / matplotlib plot?

How can I show a km ruler for a zoomed in section of a map, either inset in the image or as rulers on the side of the plot? E.g. something like the 50 km bar on the side (left) or the inset in mi...

Animation Using Cartopy

I'm trying to write a python program that displays an animation of a map of the world where countries change color based on how much renewable energy use they have. I'm trying to have it display...

Python 3.4 crashes when producing some – but not all – Cartopy maps with segmentation fault 11

I have installed the Python mapping tool Cartopy on a Mac running El Capitan 10.11.6 with Python 3.4. I can use Cartopy to successfully plot some maps but, in some cases, the Python kernel dies...

Check if geo-point is inside or outside of polygon

I am using python and I have defined the latitudes and longitudes (in degrees) of a polygon on the map. My goal is to check if a generic point P of coordinates x,y falls within such polygon. I...

Why do my google tiles look poor in a Cartopy map?

I am a bit puzzled by the rendering of google tiles with Cartopy. The map looks extremely poor compared to the standard google map look. Example (code from...

Install Cartopy & dependencies on Windows

I want to install Cartopy on Windows, which has some dependencies according to http://scitools.org.uk/cartopy/docs/latest/installing.html#installing. When using pip install cartopy in the cmd...

Cartopy system-wide location for natural earth shapefiles

Is there any location I can configure and put natural earth shapefiles that all users can use? My air-gapped system can't reach out to the internet to download files, so I need to point cartopy...

Using pip install to install Cartopy but missing Proj version at least 4.9.0

It seems that I cannot get pip to install Cartopy on my computer. I work straight from the windows command line (no Anaconda or other proxy programs). When I try "pip install cartopy" I get the...

versioneer installed, but pip install still gives ModuleNotFoundError

I have the versioneer module installed in my environment, as confirmed by running python -m versioneer --version. Yet when I pip install cartopy, I still get a ModuleNotFoundError, as shown...

Cannot install cartopy

I am using PyCharm IDE and am unable to install 'cartopy'. When I run the command `pip install cartopy' in the PyCharm terminal I receive the following error message: Collecting cartopy Using...

Matplotlib - Canvas doesn't redraw

I have an GUI created with Wxpython. In my Main GUI i show and hide some panels. Also i call a function in my Panel class "active" this should redraw an matplot with an Cartopy map and some...

Cartopy: Convert point from axes coordinates to lat/lon coordinates

I am working on a map plot with Cartopy (TransverseMercator projection). I have a point in axes coordinates (p_a = (0.1, 0.9)) and I need its lat/lon coordinates (i.e., those in PlateCarree...

Plotting a rasterio raster on a Cartopy GeoAxes

I've seen a few other questions on this topic, but the library has changed enough that the answers to those no longer seem to apply. Rasterio used to include an example for plotting a rasterio...

Plot categorical data on world map (cartopy/matplotlib)

I have a dataframe like: latitude longitude category 0 -58.5 -26.5 NaN 1 -55.5 -70.5 ET 2 -55.5 -69.5 ET 3 -55.5 -68.5 ET 4 -55.5 -67.5 ET How can I create a map like the following where the...

How do I install Cython, cartopy and shapely in a python docker container?

I am trying to get Cython, cartopy and shapely running in a docker container so I can leverage a python library traffic. I am currently getting an error with Cython: Collecting Cython==0.26 (from...

combination of normal and cartopy subplots within the same figure

I want a plot with two subplots, one larger with a map and second smaller with a scatter plot. I am using cartopy for plotting map. I determine the fraction of height by using gridspec_kw....

How to determine visible map extent for any cartopy projection?

When setting the map extent for a cartopy map that has a projection other than Plate Carree, there are areas visible on the map that are outside of the specified extent. An example of this can be...

How to create a scalebar using cartopy and matplotlib?

in respect to the previous examples in stackoverflow, I searched for other alternatives in order to create a scalebar. In my research, I verified that the Basemap class from mpl_toolkits.basemap...

How to plot maps with Python's matplotlib so that small island states are included too?

I have a basic setting for plotting data on the African map with Python matplotlib. Unfortunately the geopandas natural earth database does not include the small island states that would be...

Install prebuilt packages from conda-forge (e.g. cartopy) using poetry without relying on conda (using only the channel)

I'm testing poetry and I was wondering if it is possible to install prebuilt packages from conda-forge, as cartopy without relying on conda (so keeping a 100% poetry process). I googled this a bit...

Improve resolution of Cartopy map

The following code generates a map of the US with a contour line for every state. The problem is that the image looks like it was generated with 1990s technology. How can I significantly improve...

Moving Alaska and Hawaii in geopandas for choropleths

In R, I can move alaska and hawaii like so: https://www.storybench.org/how-to-shift-alaska-and-hawaii-below-the-lower-48-for-your-interactive-choropleth-map/ I can do it in cartopy like...

Plotting line across international dateline with Cartopy

I am trying to plot global storm tracks, but when the storms cross the dateline (and longitudes go from ~360 to ~0), the line loops all the way around the plotting space. Here's what the plot...

Plotting text in Cartopy just inside my figure

I'm trying to plot some big cities of Spain and tag them with their names, according to Natural Earth data. If I only plot the points, using ax.scatter, I get my figure correctly, without points...

Matplotlib/Cartopy: set_ticks() takes 2 positional arguments but 3 were given

I'm working on a basic plot of data on a map via xarray, matplotlib and cartopy. My problem comes from simply trying to change the x and y axis ticks to the corresponding lat/lon values. The...

Plotting with matplotlib/cartopy: ValueError: too many values to unpack (expected 3)

Ok, I'm having a hard time understanding this one. A few days ago this code worked fine and I produced dozens of maps with it. Now it's not working anymore. I reverted a conda update I did in the...

How to put a Geopandas plot on top of a matplotlib pyplot image?

At the moment, I have a plot of a certain geographic area that is coming from cartopy and I have a geometry object plotted from Geopandas, but no matter what I do I can't get them to combine into...

Cartopy error when attempting to plot rivers

When attempting to use Cartopy to plot rivers, I'm getting a URL error. I'm not even sure the rivers feature will plot what I want...I'm attempting to get the Galveston Ship Channel to show on my...

Moisture flux divergence using numpy and metpy differ

As described in this question I want to calculate moisture flux divergence at 850 hPa. For this, I have used the code described here, which makes use of the np.gradient function from the numpy...