Questions tagged [cartopy]

Cartopy is a Python package harnessing the power of matplotlib to deliver informative, precise and striking maps.

Cartopy is a Python package designed to make drawing maps for data analysis easy and enjoyable.

Primarily the non-drawing functionality of cartopy makes use of proj.4, numpy, geos and shapely; with simple and intuitive interfacing to matplotlib for map drawing.

Some of the key features of cartopy are:

  • object oriented projection definitions
  • point, line, polygon and image transformations between projections
  • integration to expose advanced mapping in matplotlib with a simple and intuitive interface
  • work-in-progress mechanisms for accessing specialist data such as those from the “Shuttle - Radar Topography Mission” (SRTM) and the “Global Self-consistent, Hierarchical, High-resolution Shoreline” database (GSHHS).

Licensed under the GNU LGPL3, cartopy's latest documentation can be found at http://scitools.org.uk/cartopy/docs/latest and the source repository at https://github.com/SciTools/cartopy

612 questions
4
votes
1 answer

Python cartopy map, clip area outside country (polygon)

I create a Stamen terrain map with the country border from NaturalEarth. Now I want to remove all the data (terrain in this case) from outside the country border. How would I do that? My example with the terrain visible inside and outside of…
yngwaz
  • 579
  • 5
  • 15
4
votes
1 answer

Borders and coastlines interfering in Python Cartopy

I'm trying to draw a map of France using Cartopy, and I'm not very comfortable with it. Searching for Python code here and there on the Internet, I built the following program: import cartopy import cartopy.feature as cfeature import cartopy.crs as…
Andrew
  • 535
  • 1
  • 5
  • 12
4
votes
1 answer

White line in contour plot in cartopy on center_longitude

I'm plotting some filled contours with Cartopy and Matplotlib. The data is on a latitude/longitude grid, and when plotting on a cartopy projection, a white line runs down the middle of the figure, or wherever I set "central_longitude" into in…
lsterzinger
  • 491
  • 2
  • 14
4
votes
2 answers

embed small map (cartopy) on matplotlib figure

# imports from collections import namedtuple import numpy as np import xarray as xr import shapely import cartopy  The data that I have looks like this. I have a region of interest (defined here as all_region). I have an xr.DataArray which contains…
Tommy Lees
  • 843
  • 7
  • 20
4
votes
0 answers

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 cached…
Sagar Jogadia
  • 1,034
  • 1
  • 15
  • 25
4
votes
2 answers

Matplotlib Circle patch does not have smooth edges

I'm trying to display Matplotlib patches using the Circle function on a map plot using cartopy geographical projections. Apparently this is supposed to give a smooth, near scale-free circular patch, however the edges are very polygonal. Strangely,…
Kris Walker
  • 153
  • 5
4
votes
2 answers

Drawing Circles with cartopy in orthographic projection

I am trying to draw circles at a given geographical coordinate with a certain radius using cartopy. I want to draw using an orthographic projection, which is centred at the centre of the circle. I use the following python code for testing: import…
Bianfable
  • 207
  • 4
  • 12
4
votes
1 answer

Animate a point moving along path between two points

I want to animate a point moving along a path from one location to another on the map. For example, I drawn a path from New York to New Delhi, using Geodetic transform. Eg. taken from docs Adding data to the map plt.plot([ny_lon, delhi_lon],…
4
votes
1 answer

Transferring basemap - cartopy

I am using basemap on Python 2.7 but would like to go for Python 3, and therefor, moving to cartopy. It would be fantastic if you would give me some advises how to change my code from basemap to cartopy: This is the basemap code: from…
KMFWeb
  • 55
  • 8
4
votes
4 answers

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 prompt, it gives an error where it wants me to install…
A T
  • 251
  • 3
  • 11
4
votes
1 answer

Adding gridlines using Cartopy

I'm trying to add gridlines to a map I made using Cartopy, however, when I use the example code from the cartopy documentation, it doesn't display what I want and I can't figure out how to manipulate it to do so. def plotMap(): proj =…
Eli Turasky
  • 679
  • 6
  • 13
4
votes
1 answer

Interpolate Temperature Data On Urban Area Using Cartopy

I'm trying to interpolate temperature data observed on an urban area formed by 5 locations. I am using cartopy to interpolate and draw the map, however, when I run the script the temperature interpolation is not shown and I only get the layer of the…
user1345283
  • 625
  • 4
  • 11
  • 17
4
votes
2 answers

Mask Ocean or Land from data using Cartopy

I would like to mask the Land area from Sea Surface Temperature Data over the globe. I am using Cartopy to plot the data. import numpy as np import matplotlib.pyplot as plt import cartopy.crs as ccrs from netCDF4 import Dataset f =…
Kushal
  • 349
  • 3
  • 12
4
votes
2 answers

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 the colors for all countries in year 1960, then the…
DVL
  • 194
  • 8
4
votes
2 answers

Straight line through the pole with Cartopy stereographic projection

I'm using cartopy to produce a map of the Arctic with stereographic projection and then plotting a line (to show the position of a cross-section) over the top. If I use the following code then the line doesn't go in a straight line through the pole…
TGraham
  • 61
  • 3