CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-cartopy

A Python package designed to make drawing maps for data analysis and visualisation easy

Pending

Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

Overview
Eval results
Files

coordinate-systems.mddocs/

Coordinate Reference Systems

Comprehensive collection of map projections and coordinate transformations. Cartopy provides object-oriented CRS definitions with support for coordinate transformations between different reference systems.

Capabilities

Base CRS Classes

Core coordinate reference system classes that provide the foundation for all projections and coordinate transformations.

class Globe:
    """Define an ellipsoid and optionally how to relate it to the real world."""
    def __init__(self, datum=None, ellipse='WGS84', semimajor_axis=None, 
                 semiminor_axis=None, flattening=None, inverse_flattening=None,
                 towgs84=None, nadgrids=None): ...

class CRS:
    """Base coordinate reference system class."""
    def __init__(self, proj4_params=None, globe=None): ...
    def transform_point(self, x, y, src_crs): ...
    def transform_points(self, src_crs, x, y, z=None): ...
    @property
    def proj4_init(self): ...
    @property
    def globe(self): ...

class Geocentric(CRS):
    """3D Cartesian coordinate system."""
    def __init__(self, globe=None): ...

class Geodetic(CRS):
    """Geographic coordinate system with latitude/longitude."""  
    def __init__(self, globe=None): ...

class RotatedGeodetic(CRS):
    """Rotated geographic coordinate system for rotated latitude/longitude."""
    def __init__(self, pole_longitude=0.0, pole_latitude=90.0, 
                 central_rotated_longitude=0.0, globe=None): ...

class RotatedPole(CRS):
    """Rotated pole coordinate system for climate and meteorological models."""
    def __init__(self, pole_longitude=0.0, pole_latitude=90.0,
                 central_rotated_longitude=0.0, globe=None): ...

Cylindrical Projections

Projections that map the globe onto a cylinder, preserving certain geometric properties.

class PlateCarree(CRS):
    """Equirectangular projection (longitude/latitude)."""
    def __init__(self, central_longitude=0.0, globe=None): ...

class Mercator(CRS):
    """Mercator projection."""
    def __init__(self, central_longitude=0.0, min_latitude=-80.0, 
                 max_latitude=84.0, globe=None): ...

class TransverseMercator(CRS):
    """Transverse Mercator projection."""
    def __init__(self, central_longitude=0.0, central_latitude=0.0,
                 false_easting=0.0, false_northing=0.0, scale_factor=1.0,
                 globe=None): ...

class UTM(TransverseMercator):
    """Universal Transverse Mercator projection."""
    def __init__(self, zone, southern_hemisphere=False, globe=None): ...

class OSGB(TransverseMercator):
    """Ordnance Survey Great Britain coordinate system."""
    def __init__(self, approx=True): ...

class Miller(CRS):
    """Miller cylindrical projection."""
    def __init__(self, central_longitude=0.0, globe=None): ...

class LambertCylindrical(CRS):
    """Lambert cylindrical equal-area projection."""
    def __init__(self, central_longitude=0.0, globe=None): ...

class ObliqueMercator(CRS):
    """Oblique Mercator projection."""
    def __init__(self, central_longitude=0.0, central_latitude=0.0,
                 azimuth=0.0, false_easting=0.0, false_northing=0.0,
                 scale_factor=1.0, globe=None): ...

Conic Projections

Projections that map the globe onto a cone, useful for mid-latitude regions.

class LambertConformal(CRS):
    """Lambert conformal conic projection."""
    def __init__(self, central_longitude=0.0, central_latitude=0.0,
                 false_easting=0.0, false_northing=0.0,
                 standard_parallels=(33, 45), globe=None): ...

class AlbersEqualArea(CRS):
    """Albers equal-area conic projection."""
    def __init__(self, central_longitude=0.0, central_latitude=0.0,
                 false_easting=0.0, false_northing=0.0,
                 standard_parallels=(20, 50), globe=None): ...

class EquidistantConic(CRS):
    """Equidistant conic projection."""
    def __init__(self, central_longitude=0.0, central_latitude=0.0,
                 false_easting=0.0, false_northing=0.0,
                 standard_parallels=(20, 50), globe=None): ...

Azimuthal Projections

Projections that preserve direction from a central point, useful for polar regions.

class Orthographic(CRS):
    """Orthographic projection."""
    def __init__(self, central_longitude=0.0, central_latitude=0.0,
                 azimuth=0.0, globe=None): ...

class Stereographic(CRS):
    """Stereographic projection."""
    def __init__(self, central_longitude=0.0, central_latitude=0.0,
                 false_easting=0.0, false_northing=0.0, scale_factor=1.0,
                 globe=None): ...

class NorthPolarStereo(Stereographic):
    """North polar stereographic projection."""
    def __init__(self, central_longitude=0.0, true_scale_latitude=None,
                 globe=None): ...

class SouthPolarStereo(Stereographic):
    """South polar stereographic projection."""
    def __init__(self, central_longitude=0.0, true_scale_latitude=None,
                 globe=None): ...

class AzimuthalEquidistant(CRS):
    """Azimuthal equidistant projection."""
    def __init__(self, central_longitude=0.0, central_latitude=0.0,
                 false_easting=0.0, false_northing=0.0, globe=None): ...

class LambertAzimuthalEqualArea(CRS):
    """Lambert azimuthal equal-area projection."""
    def __init__(self, central_longitude=0.0, central_latitude=0.0,
                 false_easting=0.0, false_northing=0.0, globe=None): ...

class Gnomonic(CRS):
    """Gnomonic projection."""
    def __init__(self, central_longitude=0.0, central_latitude=0.0, globe=None): ...

Pseudocylindrical Projections

Projections that compromise between equal-area and conformal properties for global maps.

class Mollweide(CRS):
    """Mollweide projection."""
    def __init__(self, central_longitude=0.0, globe=None): ...

class Robinson(CRS):
    """Robinson projection."""
    def __init__(self, central_longitude=0.0, false_easting=0.0,
                 false_northing=0.0, globe=None): ...

class Sinusoidal(CRS):
    """Sinusoidal projection."""
    def __init__(self, central_longitude=0.0, false_easting=0.0,
                 false_northing=0.0, globe=None): ...

class EqualEarth(CRS):
    """Equal Earth projection."""
    def __init__(self, central_longitude=0.0, false_easting=0.0,
                 false_northing=0.0, globe=None): ...

class EckertI(CRS):
    """Eckert I projection."""
    def __init__(self, central_longitude=0.0, false_easting=0.0,
                 false_northing=0.0, globe=None): ...

class EckertII(CRS):
    """Eckert II projection."""  
    def __init__(self, central_longitude=0.0, false_easting=0.0,
                 false_northing=0.0, globe=None): ...

class EckertIII(CRS):
    """Eckert III projection."""
    def __init__(self, central_longitude=0.0, false_easting=0.0,
                 false_northing=0.0, globe=None): ...

class EckertIV(CRS):
    """Eckert IV projection."""
    def __init__(self, central_longitude=0.0, false_easting=0.0,
                 false_northing=0.0, globe=None): ...

class EckertV(CRS):
    """Eckert V projection."""
    def __init__(self, central_longitude=0.0, false_easting=0.0,
                 false_northing=0.0, globe=None): ...

class EckertVI(CRS):
    """Eckert VI projection."""
    def __init__(self, central_longitude=0.0, false_easting=0.0,
                 false_northing=0.0, globe=None): ...

class InterruptedGoodeHomolosine(CRS):
    """Interrupted Goode Homolosine projection."""
    def __init__(self, central_longitude=0.0, globe=None): ...

class Aitoff(CRS):
    """Aitoff projection."""
    def __init__(self, central_longitude=0.0, globe=None): ...

class Hammer(CRS):
    """Hammer projection."""
    def __init__(self, central_longitude=0.0, globe=None): ...

class Spilhaus(CRS):
    """Spilhaus World Ocean Map projection."""
    def __init__(self, central_longitude=-160.0, globe=None): ...

Satellite Projections

Projections simulating the view from satellites or space.

class Geostationary(CRS):
    """Geostationary satellite projection."""
    def __init__(self, central_longitude=0.0, satellite_height=35785831.0,
                 false_easting=0.0, false_northing=0.0, globe=None): ...

class NearsidePerspective(CRS):
    """Near-side perspective projection."""
    def __init__(self, central_longitude=0.0, central_latitude=0.0,
                 satellite_height=10000000.0, false_easting=0.0,
                 false_northing=0.0, globe=None): ...

Usage Examples

Basic Projection Usage

import cartopy.crs as ccrs
import matplotlib.pyplot as plt

# Create different projections
plate_carree = ccrs.PlateCarree()
mercator = ccrs.Mercator()
orthographic = ccrs.Orthographic(central_longitude=-90, central_latitude=45)

# Use with matplotlib
fig, axes = plt.subplots(1, 3, figsize=(15, 5), 
                        subplot_kw={'projection': plate_carree})

for ax, proj, title in zip(axes, 
                          [plate_carree, mercator, orthographic],
                          ['PlateCarree', 'Mercator', 'Orthographic']):
    ax.set_global()
    ax.coastlines()
    ax.set_title(title)

Coordinate Transformations

import cartopy.crs as ccrs
import numpy as np

# Define source and target projections
src_crs = ccrs.PlateCarree()
target_crs = ccrs.UTM(zone=33)

# Transform points
lons = np.array([-74.0, -87.9, -118.2])  # New York, Chicago, LA
lats = np.array([40.7, 41.9, 34.1])

# Transform to UTM
x, y, z = target_crs.transform_points(src_crs, lons, lats)

Constants

WGS84_SEMIMAJOR_AXIS: float = 6378137.0
WGS84_SEMIMINOR_AXIS: float = 6356752.3142

Install with Tessl CLI

npx tessl i tessl/pypi-cartopy

docs

coordinate-systems.md

data-io.md

geodesic.md

geographic-features.md

index.md

matplotlib-integration.md

transformations.md

tile.json