Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ dependencies:
- shapely>=2.0
- pyshp>=2.3.1
- pyproj>=3.6.0
# PROJ 9.8 changes the way equicylindrical projections (PlateCarree)
# are transformed, which causes some issues. Temporary pin PROJ < 9.8
# to avoid these for now.
- proj<9.8
# The testing label has the proper version of freetype included
- conda-forge/label/testing::matplotlib-base>=3.6

Expand Down
18 changes: 11 additions & 7 deletions lib/cartopy/crs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1352,10 +1352,7 @@ def _ellipse_boundary(semimajor=2, semiminor=1, easting=0, northing=0, n=201):
class PlateCarree(_CylindricalProjection):
def __init__(self, central_longitude=0.0, globe=None):
globe = globe or Globe(semimajor_axis=WGS84_SEMIMAJOR_AXIS)
proj4_params = [('proj', 'eqc'), ('lon_0', central_longitude),
('to_meter', math.radians(1) * (
globe.semimajor_axis or WGS84_SEMIMAJOR_AXIS)),
('vto_meter', 1)]
proj4_params = [('proj', 'latlong'), ('pm', central_longitude)]
x_max = 180
y_max = 90
# Set the threshold around 0.5 if the x max is 180.
Expand Down Expand Up @@ -1385,8 +1382,8 @@ def _bbox_and_offset(self, other_plate_carree):
central longitudes. No checking of this is done.

"""
self_lon_0 = self.proj4_params['lon_0']
other_lon_0 = other_plate_carree.proj4_params['lon_0']
self_lon_0 = self.proj4_params['pm']
other_lon_0 = other_plate_carree.proj4_params['pm']

lon_0_offset = other_lon_0 - self_lon_0

Expand Down Expand Up @@ -1414,7 +1411,8 @@ def quick_vertices_transform(self, vertices, src_crs):
if return_value is None and isinstance(src_crs, PlateCarree):
self_params = self.proj4_params.copy()
src_params = src_crs.proj4_params.copy()
self_params.pop('lon_0'), src_params.pop('lon_0')
self_params.pop('pm')
src_params.pop('pm')

xs, ys = vertices[:, 0], vertices[:, 1]

Expand All @@ -1440,6 +1438,12 @@ def quick_vertices_transform(self, vertices, src_crs):

return return_value

def as_geodetic(self):
from pyproj import CRS as P_CRS
d = self.geodetic_crs.to_json_dict()
d['datum'].pop('prime_meridian', None)
return CRS(P_CRS.from_json_dict(d))


class TransverseMercator(Projection):
"""
Expand Down
2 changes: 1 addition & 1 deletion lib/cartopy/tests/mpl/test_gridliner.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import matplotlib.ticker as mticker
import numpy as np
import pytest
from shapely.geos import geos_version
from shapely import geos_version

import cartopy.crs as ccrs
from cartopy.mpl.geoaxes import GeoAxes
Expand Down
Loading