Skip to main content

Questions tagged [cartopy]

A library providing cartographic tools for python.

Filter by
Sorted by
Tagged with
0 votes
0 answers
19 views

Selecting correct extent for cartopy image

I have an image with a defined size (say, 50km x 40km) and I want to be able to place it centered at any (lon, lat) point in my map. The extent in PlateCarre units will thus be very different if is ...
Pato's user avatar
  • 1
0 votes
0 answers
19 views

Error in display the image by cartopy

I want to visualize the image using cartopy. The image shows OK in the geemap. The coding as follow: import ee import geemap import cartopy.crs as ccrs import the cartoee functionality from geemap ...
Molly cao's user avatar
0 votes
2 answers
141 views

Rasterio & rioxarray no longer compatible with fairly standard modules

I just bought a new computer and want to read a geotiff and plot it in cartopy. I'm typing: conda create --name my_env conda activate my_env conda install numpy pandas jupyter cartopy xarray ...
Robbie Mallett's user avatar
4 votes
1 answer
613 views

Labelling a Map

I have a map I have made using python, matplotlib, cartopy and shapely. It has a coast, county borders, lakes and rivers. I also shade in districts, in the form of polygons, on the map in order to ...
Baz's user avatar
  • 77
1 vote
1 answer
198 views

Cannot plot with Cartopy: Incomplete shapefile definition error BUT .shp .shx and .dbf are all present

I used to plot maps with Cartopy, which actually used to work fine until now. Recently, when adding the maps features to a plot (es. coastlines etc) I get this error: "ValueError: Incomplete ...
Noelle_L's user avatar
0 votes
0 answers
117 views

Using the Arctic SDI WMTS with cartopy and matplotlib

I am trying to use the Arctic SDI topographic basemap (https://arctic-sdi.org/services/topografic-basemap/) with cartopy + matplotlib in python, but seemingly without success. It seems that for some ...
dfghhjj's user avatar
1 vote
1 answer
87 views

Barplot with a basemap as a background

I have some data as a pandas DataFrame with values associated with longitude. I have plotted it as stacked bars like this: A subset of the data as an example via df.to_dict(): {'Commodity driven ...
Jan Pisl's user avatar
  • 736
1 vote
0 answers
98 views

Plot raster in synusoidal projection in python

I want to plot data in a matrix, with two other matrices with coordinates, with a sinusoidal projection, in Python. I read data and coordinates from HDF5 or NetCDF files in the form of numpy arrays. ...
Ferny's user avatar
  • 21
0 votes
0 answers
136 views

How to get bbox coordinates of text on cartopy map

I'm making a map using cartopy in python and am labeling the countries based on the centroid of the country. However, if a name extends outside of the map's crop I would like to move the label so that ...
JWB's user avatar
  • 604
2 votes
0 answers
242 views

Create circular grid line labels (labels around the map's border) for a South Polar Stereo projection

I'm using the South Polar Stereographic projection to create a map of Antarctica. I've been able to create the gridlines using Cartopy, but the labels for the gridlines are not circular around the map,...
Rony Golder's user avatar
1 vote
2 answers
487 views

Problem with cartopy when a shapefile as lon > 180

I am trying to make a figure using a shapefile and cartopy. When longitudes are in the range [-180,180] everything is working fine When longitudes are in the range [0, 360] the shapefile is not ...
Vincent Poitras's user avatar
0 votes
1 answer
151 views

Labelling contour lines along a great circle

I'd really like to show the satellite zenith angle as seen from an observer on the ground. I can calculate everything just fine and get a graph that is useful and passable. import numpy as np import ...
K. Shores's user avatar
  • 101
0 votes
1 answer
152 views

Continuous variable in Cartopy

I have been trying for some time to plot shapefile polygons on a global map using Cartopy library. From this post, I have been trying to plot a continuous variable from an attribute called "ShIdx&...
GoldenTomato's user avatar
1 vote
0 answers
316 views

How to plot the map correctly over the SST data in cartopy?

I am trying to plot L2 Sea Surface Temperature data and I want to plot it over the globe in a geostationary projection. I tried the following code: import h5py import sys import numpy as np import ...
The Emerging Star's user avatar
0 votes
1 answer
146 views

Timelapse only shows single year in Google Earth Engine (ERA5 Daily agg.)

I am trying to make a yearly timelapse of ERA5 Daily aggregates (precipitation) using cartopy but the output gif and images generated show the plots of single year. I am trying to extract the images ...
Muhammad Iqbal's user avatar
0 votes
1 answer
420 views

Feature/shapefile does not show up in Python

This is the code I have fname = r"C:\Users\Kevin Abbot\Documents\W&OD Trail.shp" shape_feature = ShapelyFeature(Reader(fname).geometries(), ccrs....
user207752's user avatar
2 votes
1 answer
788 views

Plot 2D geodata as function of longitude and latitude

I would like to plot from the following NetCDF file (R90C_20P_MSG_201403250100.nc) the 2d array RFnet as function of the 2d arrays LONGITUDE and LATITUDE. Download of NetCDF file: https://gigamove....
mrz's user avatar
  • 131
1 vote
1 answer
8k views

plt.title not displaying

I am unable to add plt.title import numpy as np import geopandas as gpd from shapely.geometry.polygon import LinearRing import pyproj import cartopy.crs as ccrs import cartopy.feature as cfeature ...
arkriger's user avatar
  • 337
1 vote
1 answer
2k views

Increase map size with subplots and Cartopy

I try to make subplot maps with Cartopy using data from xarray tutorial and increase each map in vertical size, but failed. Also making colorbar at each specific subplots. import matplotlib.pyplot as ...
Tuyen's user avatar
  • 211
2 votes
1 answer
655 views

How to produce a Cartopy map in UTM with north-east up?

I'm currently trying to produce maps of a shoreline, which runs roughly from south-east - north-west in an UTM projection to visualize shoreline change. By default Cartopy maps are in north up. Is ...
eimes's user avatar
  • 43
2 votes
1 answer
756 views

Plotting GeoTIFF using Cartopy

I am trying to plot a SAR image, in TIFF format and containing the following projection arguments, using Cartopy. PROJCS["WGS 84 / EPSG Norway Polar Stereographic", GEOGCS["WGS 84",...
vicemagui's user avatar
1 vote
0 answers
868 views

Ploting GEE image with imshow and adding an cartopy.io.img_tiles using add_image

I transformed a GEE image in an numpy array and I'm trying to plot a this array using plt.imshow() with a background image of cartopy image tiles (cimgt) with .add_image(). However, the array and ...
Izaeljr's user avatar
  • 13
0 votes
0 answers
201 views

Basemap npstere to cartopy NorthPolarStereo CRS

Somebody has given me the following code to convert north-polar stereographic (x,y) coordinates to WGS84 (lon,lats): m = Basemap(projection='npstere',boundinglat=60,lon_0=0,resolution='l') lon,lat = m(...
Robbie Mallett's user avatar
3 votes
1 answer
1k views

Reading CRS from shapefile and plotting with Cartopy

I read a shapefile containing geometries that I want to plot using Cartopy. My challenge is finding the correct CRS projection to use for this. The .prj file contains this information: PROJCS["...
Trond Kristiansen's user avatar
1 vote
1 answer
2k views

Can not resolve the error: Incomplete shapefile definition in 'filename.shp'

I'm trying to add a feature to draw a map but this error: "Incomplete shapefile definition in 'eez v11.shp'" keeps popping. Here is the code I wrote: fname = 'eez_v11.shp' shape_feature = ...
Sarah Landru's user avatar
0 votes
0 answers
152 views

Problem with globe in cartopy

I have radar meteorological data in an Azimuthal Equidistant projection and I want to georreference it. I would know how to do it if the data were refered to the typical WGS-84 ellipsoid, but it isn't ...
David's user avatar
  • 133
0 votes
1 answer
525 views

Getting proj string from cartopy CRS

I'm trying to get proj strings from cartopy crs', such as cartopy.crs.PlateCarree(). I can manually infer the proj string from the init() function in the source code but I need to query it, so I can ...
Scott's user avatar
  • 1
1 vote
1 answer
1k views

Plotting high latitude bounding box using cartopy

I have used the sentinelhub python api to download a Sentinel-1 scene corresponding to the north coast of greenland where a bounding box defined by lon-lat is highly distorted. I have tried a few ...
Robbie Mallett's user avatar
0 votes
1 answer
1k views

How to plot coordinate system from EPSG 4326 on north pole centered map in Python?

I have the following pandas dataframe (df) which looks like this with column headers and data values, 3 points each: temperature: array([-101.6015625, -100.9296875, -85.4296875]) latitude: array([32....
apollowebdesigns's user avatar
1 vote
1 answer
273 views

Define your own latitude and longitude projection

I am converting (rotating) vectors from Lambert to latlon (and viceversa) in Python. But in Basemap or Cartopy, I see that you do not define the lat and lon projections, you just define your Lambert, ...
David's user avatar
  • 133
3 votes
1 answer
2k views

Creating map of pacific with cartopy

I'm trying to plot a map of the Pacific with Japan and California in view, but am having some problems. Here's my script: import cartopy.crs as ccrs import cartopy.feature as cfeature import ...
user avatar
2 votes
2 answers
299 views

Obtain CRS from existing axis with cartopy

Is there a method to get the CRS from a figure created with cartopy? Say for example, I only had access to the ax created here: import cartopy.crs as ccrs import matplotlib.pyplot as plt plt.figure(...
bbuzz31's user avatar
  • 429
0 votes
2 answers
1k views

GEOSGeom_createLinearRing_r returned a NULL pointer

I want to import cartopy on Python3, but it keeps showing me File "shapely\speedups\_speedups.pyx", line 408, in shapely.speedups._speedups.geos_linearring_from_py ...
dong's user avatar
  • 1
1 vote
1 answer
260 views

Cartopy unable to find tilematrix for projection

I am currently trying to run the example script from cartopy import matplotlib.pyplot as plt import cartopy.crs as ccrs from cartopy.io.shapereader import FionaReader import os import fiona def main()...
PythonIsHard's user avatar
1 vote
0 answers
416 views

Plotting city locations on Python 3 [closed]

My question is a follow-up of this: plotting US cities on a map with matplotlib and basemap. I would like to use some Python library to plot on a map city locations, starting from a list like this: ...
fisherking's user avatar
0 votes
1 answer
1k views

Plotting xarray over background map using cartopy

I am trying to plot an xarray DataArray over a background map using cartopy. When including the background map, the DataArray is not visible, although the map has an appropriate extent. I am adding ...
tvoirand's user avatar
  • 298
0 votes
0 answers
808 views

GeoPandas and Cartopy how to dynamically zoom to Multiline

I am new to GeoPandas and Cartopy. I am trying to generate map plots for different regions dynamically. When generating the image from geopandas ('df.plot()') the size is correct, but when I generate ...
Anselm Scholz's user avatar
1 vote
0 answers
117 views

Issue with circular patterns showing up after orthographic projection

For a project I'm working on, I'm trying to project a GOES-16 image to an orthographic projection centred at the continental United States. In a later stage, I found these odd circular patterns appear ...
flymetothemoon200's user avatar
1 vote
1 answer
991 views

Distance to coastline in meters using Cartopy and Shapely

I am trying to calculate the distance to coastline for some points. Using Cartopy and Shapely, I can calculate the distance in degrees, but that is not very helpful. Perhaps if I could transform the ...
user14241's user avatar
  • 344
0 votes
1 answer
1k views

Clip global data by polygon using rioxarray fails (off by 180 longitude)

I want to extract CMIP6 climate data within polygons defined by a selection of the Large Marine Ecosystems of the world. The data(CMIP6) are found in ranges from 0 to 360 degrees longitude, while my ...
Trond Kristiansen's user avatar
1 vote
0 answers
813 views

Displaying projection with IMSHOW()

I am having an issue displaying satellite data on the correctly projection using cartopy and imshow. I am unsure of the initial data projection, but I am trying to put it into Plate Carree with a ...
WxJack's user avatar
  • 11
1 vote
0 answers
369 views

Single country coastlines in Python Matplotlib Cartopy

In the image below I am using cartopy to plot coastlines. But, I only wish to have the coastlines of Australia, and not the surrounding countries. Is there a way to remove the other countries. Here ...
Alex Borowiak's user avatar
3 votes
2 answers
3k views

Calculating geodesic distance along a path (lat/lon points) at once?

Using Python 3.7 with Jupyter Notebook on a Win10 x64. I have a list of lat-long tuples representing a path and I want to calculate the total length along that path in meters (or km, miles etc). I ...
VictorX's user avatar
  • 31
2 votes
0 answers
457 views

Estimating a Rotated Pole given a gridded dataset with lat/lons at each point

I have netcdf dataset that I think is regular gridded dataset using a Rotated pole mapping, but the rotated pole information is wrong. For those not familiar with Rotated Poles, the cartopy ...
naught101's user avatar
  • 496
5 votes
2 answers
9k views

Increasing resolution of Cartopy stock background?

I am trying to create a small application that will show zoomed in maps. If possible, I would like to avoid using map tiles. Going off the example on this page: https://scitools.org.uk/cartopy/docs/...
Dan's user avatar
  • 51
0 votes
1 answer
841 views

Geoplot/Cartopy Orthographic projection won't work near equator

I am having trouble getting Geoplot's Orthographic projection to work near the equator. It works fine at locations ±90 longitude where latitude is right at 0, but if I run the code below, it fails ...
Zachary Klaas's user avatar
-1 votes
1 answer
359 views

cartopy and xarray issues

I'm beginning to use netCDF4 data and therefore I have downloaded xarray and also cartopy (with pip). I have downloaded data from the climate data store and want to plot these data. I have a notebook ...
Slvn znl's user avatar
0 votes
1 answer
955 views

Cartopy lakes and rivers are clipped

I'm trying to produce a map showing water bodies like oceans/rivers/lakes polygons for purposes of plotting vessel voyages using cartopy. Ultimately I'm looking to create a sea mesh grid using the ...
Winston Tan's user avatar
2 votes
1 answer
2k views

Displaying geopandas points with cartopy

I am trying to display a GeoDataFrame containing points, using cartopy. I first tried to follow the indications given in the documentation of geopandas. However, the points are not displayed: ...
LCT's user avatar
  • 231
1 vote
1 answer
973 views

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 ...
user1345283's user avatar