or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

Files

docs

coordinate-systems.mddata-io.mdgeodesic.mdgeographic-features.mdindex.mdmatplotlib-integration.mdtransformations.md

coordinate-systems.mddocs/

0

# Coordinate Reference Systems

1

2

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

3

4

## Capabilities

5

6

### Base CRS Classes

7

8

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

9

10

```python { .api }

11

class Globe:

12

"""Define an ellipsoid and optionally how to relate it to the real world."""

13

def __init__(self, datum=None, ellipse='WGS84', semimajor_axis=None,

14

semiminor_axis=None, flattening=None, inverse_flattening=None,

15

towgs84=None, nadgrids=None): ...

16

17

class CRS:

18

"""Base coordinate reference system class."""

19

def __init__(self, proj4_params=None, globe=None): ...

20

def transform_point(self, x, y, src_crs): ...

21

def transform_points(self, src_crs, x, y, z=None): ...

22

@property

23

def proj4_init(self): ...

24

@property

25

def globe(self): ...

26

27

class Geocentric(CRS):

28

"""3D Cartesian coordinate system."""

29

def __init__(self, globe=None): ...

30

31

class Geodetic(CRS):

32

"""Geographic coordinate system with latitude/longitude."""

33

def __init__(self, globe=None): ...

34

35

class RotatedGeodetic(CRS):

36

"""Rotated geographic coordinate system for rotated latitude/longitude."""

37

def __init__(self, pole_longitude=0.0, pole_latitude=90.0,

38

central_rotated_longitude=0.0, globe=None): ...

39

40

class RotatedPole(CRS):

41

"""Rotated pole coordinate system for climate and meteorological models."""

42

def __init__(self, pole_longitude=0.0, pole_latitude=90.0,

43

central_rotated_longitude=0.0, globe=None): ...

44

```

45

46

### Cylindrical Projections

47

48

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

49

50

```python { .api }

51

class PlateCarree(CRS):

52

"""Equirectangular projection (longitude/latitude)."""

53

def __init__(self, central_longitude=0.0, globe=None): ...

54

55

class Mercator(CRS):

56

"""Mercator projection."""

57

def __init__(self, central_longitude=0.0, min_latitude=-80.0,

58

max_latitude=84.0, globe=None): ...

59

60

class TransverseMercator(CRS):

61

"""Transverse Mercator projection."""

62

def __init__(self, central_longitude=0.0, central_latitude=0.0,

63

false_easting=0.0, false_northing=0.0, scale_factor=1.0,

64

globe=None): ...

65

66

class UTM(TransverseMercator):

67

"""Universal Transverse Mercator projection."""

68

def __init__(self, zone, southern_hemisphere=False, globe=None): ...

69

70

class OSGB(TransverseMercator):

71

"""Ordnance Survey Great Britain coordinate system."""

72

def __init__(self, approx=True): ...

73

74

class Miller(CRS):

75

"""Miller cylindrical projection."""

76

def __init__(self, central_longitude=0.0, globe=None): ...

77

78

class LambertCylindrical(CRS):

79

"""Lambert cylindrical equal-area projection."""

80

def __init__(self, central_longitude=0.0, globe=None): ...

81

82

class ObliqueMercator(CRS):

83

"""Oblique Mercator projection."""

84

def __init__(self, central_longitude=0.0, central_latitude=0.0,

85

azimuth=0.0, false_easting=0.0, false_northing=0.0,

86

scale_factor=1.0, globe=None): ...

87

```

88

89

### Conic Projections

90

91

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

92

93

```python { .api }

94

class LambertConformal(CRS):

95

"""Lambert conformal conic projection."""

96

def __init__(self, central_longitude=0.0, central_latitude=0.0,

97

false_easting=0.0, false_northing=0.0,

98

standard_parallels=(33, 45), globe=None): ...

99

100

class AlbersEqualArea(CRS):

101

"""Albers equal-area conic projection."""

102

def __init__(self, central_longitude=0.0, central_latitude=0.0,

103

false_easting=0.0, false_northing=0.0,

104

standard_parallels=(20, 50), globe=None): ...

105

106

class EquidistantConic(CRS):

107

"""Equidistant conic projection."""

108

def __init__(self, central_longitude=0.0, central_latitude=0.0,

109

false_easting=0.0, false_northing=0.0,

110

standard_parallels=(20, 50), globe=None): ...

111

```

112

113

### Azimuthal Projections

114

115

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

116

117

```python { .api }

118

class Orthographic(CRS):

119

"""Orthographic projection."""

120

def __init__(self, central_longitude=0.0, central_latitude=0.0,

121

azimuth=0.0, globe=None): ...

122

123

class Stereographic(CRS):

124

"""Stereographic projection."""

125

def __init__(self, central_longitude=0.0, central_latitude=0.0,

126

false_easting=0.0, false_northing=0.0, scale_factor=1.0,

127

globe=None): ...

128

129

class NorthPolarStereo(Stereographic):

130

"""North polar stereographic projection."""

131

def __init__(self, central_longitude=0.0, true_scale_latitude=None,

132

globe=None): ...

133

134

class SouthPolarStereo(Stereographic):

135

"""South polar stereographic projection."""

136

def __init__(self, central_longitude=0.0, true_scale_latitude=None,

137

globe=None): ...

138

139

class AzimuthalEquidistant(CRS):

140

"""Azimuthal equidistant projection."""

141

def __init__(self, central_longitude=0.0, central_latitude=0.0,

142

false_easting=0.0, false_northing=0.0, globe=None): ...

143

144

class LambertAzimuthalEqualArea(CRS):

145

"""Lambert azimuthal equal-area projection."""

146

def __init__(self, central_longitude=0.0, central_latitude=0.0,

147

false_easting=0.0, false_northing=0.0, globe=None): ...

148

149

class Gnomonic(CRS):

150

"""Gnomonic projection."""

151

def __init__(self, central_longitude=0.0, central_latitude=0.0, globe=None): ...

152

```

153

154

### Pseudocylindrical Projections

155

156

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

157

158

```python { .api }

159

class Mollweide(CRS):

160

"""Mollweide projection."""

161

def __init__(self, central_longitude=0.0, globe=None): ...

162

163

class Robinson(CRS):

164

"""Robinson projection."""

165

def __init__(self, central_longitude=0.0, false_easting=0.0,

166

false_northing=0.0, globe=None): ...

167

168

class Sinusoidal(CRS):

169

"""Sinusoidal projection."""

170

def __init__(self, central_longitude=0.0, false_easting=0.0,

171

false_northing=0.0, globe=None): ...

172

173

class EqualEarth(CRS):

174

"""Equal Earth projection."""

175

def __init__(self, central_longitude=0.0, false_easting=0.0,

176

false_northing=0.0, globe=None): ...

177

178

class EckertI(CRS):

179

"""Eckert I projection."""

180

def __init__(self, central_longitude=0.0, false_easting=0.0,

181

false_northing=0.0, globe=None): ...

182

183

class EckertII(CRS):

184

"""Eckert II projection."""

185

def __init__(self, central_longitude=0.0, false_easting=0.0,

186

false_northing=0.0, globe=None): ...

187

188

class EckertIII(CRS):

189

"""Eckert III projection."""

190

def __init__(self, central_longitude=0.0, false_easting=0.0,

191

false_northing=0.0, globe=None): ...

192

193

class EckertIV(CRS):

194

"""Eckert IV projection."""

195

def __init__(self, central_longitude=0.0, false_easting=0.0,

196

false_northing=0.0, globe=None): ...

197

198

class EckertV(CRS):

199

"""Eckert V projection."""

200

def __init__(self, central_longitude=0.0, false_easting=0.0,

201

false_northing=0.0, globe=None): ...

202

203

class EckertVI(CRS):

204

"""Eckert VI projection."""

205

def __init__(self, central_longitude=0.0, false_easting=0.0,

206

false_northing=0.0, globe=None): ...

207

208

class InterruptedGoodeHomolosine(CRS):

209

"""Interrupted Goode Homolosine projection."""

210

def __init__(self, central_longitude=0.0, globe=None): ...

211

212

class Aitoff(CRS):

213

"""Aitoff projection."""

214

def __init__(self, central_longitude=0.0, globe=None): ...

215

216

class Hammer(CRS):

217

"""Hammer projection."""

218

def __init__(self, central_longitude=0.0, globe=None): ...

219

220

class Spilhaus(CRS):

221

"""Spilhaus World Ocean Map projection."""

222

def __init__(self, central_longitude=-160.0, globe=None): ...

223

```

224

225

### Satellite Projections

226

227

Projections simulating the view from satellites or space.

228

229

```python { .api }

230

class Geostationary(CRS):

231

"""Geostationary satellite projection."""

232

def __init__(self, central_longitude=0.0, satellite_height=35785831.0,

233

false_easting=0.0, false_northing=0.0, globe=None): ...

234

235

class NearsidePerspective(CRS):

236

"""Near-side perspective projection."""

237

def __init__(self, central_longitude=0.0, central_latitude=0.0,

238

satellite_height=10000000.0, false_easting=0.0,

239

false_northing=0.0, globe=None): ...

240

```

241

242

## Usage Examples

243

244

### Basic Projection Usage

245

246

```python

247

import cartopy.crs as ccrs

248

import matplotlib.pyplot as plt

249

250

# Create different projections

251

plate_carree = ccrs.PlateCarree()

252

mercator = ccrs.Mercator()

253

orthographic = ccrs.Orthographic(central_longitude=-90, central_latitude=45)

254

255

# Use with matplotlib

256

fig, axes = plt.subplots(1, 3, figsize=(15, 5),

257

subplot_kw={'projection': plate_carree})

258

259

for ax, proj, title in zip(axes,

260

[plate_carree, mercator, orthographic],

261

['PlateCarree', 'Mercator', 'Orthographic']):

262

ax.set_global()

263

ax.coastlines()

264

ax.set_title(title)

265

```

266

267

### Coordinate Transformations

268

269

```python

270

import cartopy.crs as ccrs

271

import numpy as np

272

273

# Define source and target projections

274

src_crs = ccrs.PlateCarree()

275

target_crs = ccrs.UTM(zone=33)

276

277

# Transform points

278

lons = np.array([-74.0, -87.9, -118.2]) # New York, Chicago, LA

279

lats = np.array([40.7, 41.9, 34.1])

280

281

# Transform to UTM

282

x, y, z = target_crs.transform_points(src_crs, lons, lats)

283

```

284

285

## Constants

286

287

```python { .api }

288

WGS84_SEMIMAJOR_AXIS: float = 6378137.0

289

WGS84_SEMIMINOR_AXIS: float = 6356752.3142

290

```