Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip: no quick transform, when there is no vertices #1380

Closed
Closed
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
6 changes: 5 additions & 1 deletion lib/cartopy/crs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ def quick_vertices_transform(self, vertices, src_crs):
if vertices.size == 0:
return vertices

if self == src_crs:
if self == src_crs and len(vertices) > 0:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because of the lines 1250-1251, which were added at #2213, I don’t think this check will ever be exercised.

x = vertices[:, 0]
y = vertices[:, 1]
# Extend the limits a tiny amount to allow for precision mistakes
Expand Down Expand Up @@ -1372,6 +1372,10 @@ def _bbox_and_offset(self, other_plate_carree):
def quick_vertices_transform(self, vertices, src_crs):
return_value = super().quick_vertices_transform(vertices, src_crs)

# if there is no vertices
if len(vertices) == 0:
return return_value

# Optimise the PlateCarree -> PlateCarree case where no
# wrapping or interpolation needs to take place.
if return_value is None and isinstance(src_crs, PlateCarree):
Expand Down