Skip to content

Coastlines shifted when using add_image with Orthographic projection centered on dateline #2579

@koenigleon

Description

@koenigleon

When using ax.add_image(cimgt.GoogleTiles(), …) in an Orthographic projection with central_longitude=180, the coastlines from the image tiles are noticeably shifted relative to the actual coastlines.

Environment: python=3.11.9, matplotlib=3.10.3, cartopy=0.25.0

from matplotlib import pyplot as plt
import cartopy.crs as ccrs
import cartopy.io.img_tiles as cimgt

ax = plt.axes(projection=ccrs.Orthographic(central_longitude=180))
ax.add_image(cimgt.GoogleTiles(), 2)
ax.coastlines()
plt.show()
Image

When using lower zoom levels (e.g., ax.add_image(cimgt.GoogleTiles(), 1)) the coastlines seem to align, as expected.

ax = plt.axes(projection=ccrs.Orthographic(central_longitude=180))
ax.add_image(cimgt.GoogleTiles(), 1)
ax.coastlines()
plt.show()
Image

Is this expected behaviour for Web Mercator image tiles? Is there a fix for this to prevent images tiles with zoom levels higher than 2 from becoming misaligned?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions