Questions tagged [cartopy]
A library providing cartographic tools for python.
48
questions
0
votes
1
answer
26
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....
1
vote
1
answer
16
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....
0
votes
1
answer
73
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
...
1
vote
1
answer
89
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 ...
1
vote
0
answers
59
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 ...
0
votes
0
answers
40
views
Making subplots with cartoee and cartopy
I try to plot four MODIS LST maps in each subplots (my case is 4 plots), but I can only be able to plot one and also not properly position. Here is my code.
import ee
import geemap
import matplotlib....
2
votes
1
answer
162
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",...
0
votes
0
answers
15
views
Projection causes interpolation error?
I'm trying to do an interpolation with matplotlibs tri function, but the results show as empty for some reason.
Specifically, I am trying to interpolate rainfall across an island given 41 weather ...
0
votes
0
answers
227
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 ...
0
votes
0
answers
78
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
0
answers
120
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
0
answers
87
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
1
answer
404
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
1
answer
466
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
0
answers
51
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
1
answer
94
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
1
answer
412
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
1
answer
463
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....
1
vote
1
answer
131
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
1
answer
785
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
1
answer
118
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
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
...
1
vote
1
answer
115
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
0
answers
169
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
1
answer
644
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
0
answers
323
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
0
answers
86
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
1
answer
426
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
1
answer
594
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
0
answers
588
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
0
answers
207
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
2
answers
2k
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
0
answers
329
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
1
answer
6k
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
1
answer
656
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
1
answer
261
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
1
answer
676
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 ...
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:
...
1
vote
1
answer
794
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
0
answers
659
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
2
answers
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/...
3
votes
0
answers
2k
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
1
answer
4k
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
1
answer
2k
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
1
answer
8k
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
0
answers
974
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
0
answers
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
1
answer
15k
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 ...