Skip to content

fix: remove forced PlateCarree projection in add_layer issue (#2730)#2828

Open
alepr wants to merge 1 commit into
gee-community:masterfrom
alepr:fix/cartoeeAddLayerProj
Open

fix: remove forced PlateCarree projection in add_layer issue (#2730)#2828
alepr wants to merge 1 commit into
gee-community:masterfrom
alepr:fix/cartoeeAddLayerProj

Conversation

@alepr

@alepr alepr commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR fixes an issue where the add_layer function forced ccrs.PlateCarree() by default, causing rendering errors when using custom projections. Fixes #2730

Changes

  • Removed the forced ccrs.PlateCarree() coordinate system in ax.imshow().
  • The function now correctly respects the user-defined projection.

Testing

Copilot AI review requested due to automatic review settings July 11, 2026 22:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates geemap/cartoee.py to support custom map projections by passing the projection (proj) through kwargs from get_map to add_layer. In add_layer, the projection is retrieved and used as the transform parameter. The feedback suggests a more idiomatic Python approach using kwargs.get() to simplify the projection retrieval logic.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread geemap/cartoee.py
Comment on lines +154 to +157
if "proj" in kwargs:
proj = kwargs["proj"]
else:
proj = ccrs.PlateCarree()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Using dict.get() is a more idiomatic and concise way to retrieve a value with a default fallback in Python, replacing the multi-line if-else block.

    proj = kwargs.get("proj", ccrs.PlateCarree())

@alepr alepr force-pushed the fix/cartoeeAddLayerProj branch from 2e5fc31 to 4499fa3 Compare July 14, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue: geemap cartoee.get_map() ignores region parameter and results in low resolution when using ax.set_extent()

2 participants