Add longitude_extent parameter to LambertConformal projection #2597
+33
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rationale
This PR adds a
longitude_extentparameter to theLambertConformalprojection to allow control over the map's longitudinal coverage.Previously, the longitudinal extent was hardcoded at 180° on each side of the central meridian, which meant the projection always covered a full hemisphere. While
set_extent()can be used to crop the view, it doesn't change the underlying projection boundary, often resulting in suboptimal axis limits for regional maps.With this parameter, users can create more appropriate projection boundaries for regional applications where a full hemisphere coverage is unnecessary.
This is an updated version of #1665, rebased on the current main branch.
Implications
longitude_extent(default: 180) toLambertConformal.__init__longitude_extentinstead of the hardcoded 180° valueChecklist
longitude_extentparameter with default value of 180 to maintain backward compatibilitytest_longitude_extent()inlib/cartopy/tests/crs/test_lambert_conformal.pyto verify the parameter controls boundary extentExample use