Questions tagged [cartopy]

A library providing cartographic tools for python.

Filter by
Sorted by
Tagged with
0
votes
0answers
21 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(...
0
votes
0answers
15 views

Map is not getting plotted in Matplotlib Cartopy [closed]

It was this simple code that I was trying to run on Jupyter to plot the map of the world with the projection- Albers. I was unable to visualize the map itself within the boundary (Added the screenshot ...
0
votes
0answers
29 views

How to show RGB image with latitude and longitude in Python?

I need to create an RGB figure based on an HDF5 file, which consists of latitude layer, longitude layer, and different band data layers. However, the ax.contourf() function only receive 2-dimensions(...
0
votes
0answers
38 views

Replacing mpl_toolkits.basemap functionality to create figure with monthly NASA Blue Marble image

I'd like to uncouple the deprecated mpl_toolkits.basemap calls from this inherited code and replace it with something that will be supported going forward - they recommend Cartopy but I'm open to ...
2
votes
1answer
126 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["...
1
vote
1answer
189 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 = ...
0
votes
0answers
34 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 ...
0
votes
0answers
21 views

How can I overlay an image (calculated from arrays) on a map (Mercator proj) by coordinates?

I have a HDF file with 3 arrays for the image, c 2 for the coordinates (lat lon). Arrays of size 2784 2784. I'm trying to draw an RGB image: import cartopy import cartopy.crs as ccrs import skimage....
0
votes
1answer
21 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 ...
1
vote
1answer
163 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 ...
0
votes
1answer
190 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....
0
votes
0answers
34 views

Weird differences between basemap rotate_vector and Cartopy transform_vectors

I define a Lambert Conical Conformal in both Cartopy and Basemap import numpy as np from mpl_toolkits.basemap import Basemap #Cartopy: lam2 = ccrs.LambertConformal(central_longitude=-2....
1
vote
1answer
69 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, ...
3
votes
1answer
323 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 ...
2
votes
1answer
48 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(...
0
votes
2answers
877 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 ...
1
vote
1answer
68 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()...
1
vote
0answers
115 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: ...
0
votes
1answer
381 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 ...
0
votes
0answers
219 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 ...
1
vote
0answers
60 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 ...
1
vote
1answer
228 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 ...
0
votes
1answer
376 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 ...
1
vote
0answers
507 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 ...
1
vote
0answers
154 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 ...
3
votes
2answers
1k 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 ...
2
votes
0answers
260 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 ...
4
votes
1answer
5k 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/...
0
votes
1answer
558 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 ...
-1
votes
1answer
225 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 ...
0
votes
1answer
606 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 ...
1
vote
1answer
1k 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: ...
1
vote
1answer
675 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 ...
1
vote
0answers
570 views

Add geopandas to cartopy

How can I add a geopandas geodataframe to a cartopy map? My objective is to create a large number of PNGs to turn into a GIF. The geopandas default plotting options are limited so I would like to ...
3
votes
2answers
2k views

Shapefiles won't display with cartopy

I'm trying my first GIS project with cartopy and matplotlib and I'm having some trouble displaying some shapefiles. The shapefiles were downloaded from here: http://data.vancouver.ca/datacatalogue/...
2
votes
0answers
1k views

Cartopy image tiles - determining possible zoom level in advance?

In Cartopy I'm using an image tile like so: terrain_tile = cimgt.StamenTerrain() ax.add_image(tile, zoom) By default I've set the zoom level to 14 and that works perfectly for my first test case. ...
5
votes
1answer
3k views

How do I set extent in a geopandas plot (as in cartopy)?

The usual. My shapefile is from a much bigger place than my data, and I want to zoom in. The dark dot below is Melbourne, and it has some very interesting data plotted on it. base.plot(linewidth=0 ...
1
vote
1answer
1k views

Rotating geometry in cartopy?

I would like to use cartopy to display a map of the cities in the contiguous United States. In order to do so, I have written the following code (the data comes from here): import geopandas as gpd ...
4
votes
1answer
7k views

cartopy: plotting shapefiles

I am new to gis and am trying to plot a shapefile containing land polygons. (From OSM.) Unfortunately my output image is always empty (i.e. white). Can somebody tell me what I am doing wrong? import ...
1
vote
0answers
887 views

Error and kernel dies with shapely/geos inside Jupyter notebook

I have a Python 2.7 script (code below) that scrapes data from a table on the web and draws a map. It runs fine from the command line using $ python bears.py When I run the identical script from ...
3
votes
0answers
1k views

Installing cartopy on OSGeo4W

I am trying to install cartopy on OSGeo4W. Even though all required packages already downloaded and updated, the installer won't recognize them. I keep getting the following error: setup.py:168: ...
5
votes
1answer
14k views

Python Mapping in Matplotlib Cartopy Color One Country

I have plotted a map of the world using matplotlib Cartopy. Now I want to select a specific country in the map in this case the United States and change the color. I think this is possible but not ...