-
Couldn't load subscription status.
- Fork 0
adding utilities for handling shapes that cross the AM #26
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
base: main
Are you sure you want to change the base?
Conversation
abradley60
commented
Oct 17, 2025
- Adding utilities for handling shapes that cross the antimeridian
- check if Polygons / MultiPolygons cross the antimeridian
- Provide functions to get the appropriate bounds if they do
- Add doc string to dem handler
- Clean and add new tests for functions
- Add an antimeridian example to the README.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all looks good to me. I've made a couple of suggestions to add comments or improve clarity of documentation
| f"Provided shape : {shape}" | ||
| ) | ||
|
|
||
| min_x = max(west_longitudes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| min_x = max(west_longitudes) | |
| # For a valid set of bounds that cross the antimeridian, the minimum value of x corresponds to the maximum negative longitude in the western hemisphere; the maximum value of x corresponds to the minimum positive longitude in the eastern hemisphere. | |
| min_x = max(west_longitudes) |
|
|
||
| min_x = max(west_longitudes) | ||
| max_x = min(east_longitudes) | ||
| min_y = min(latitudes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| min_y = min(latitudes) | |
| # minimum and maximum values of y correspond to the minimum and maximum latitudes. | |
| min_y = min(latitudes) |
| ) -> bool: | ||
| """Check if the provided bounds cross the antimeridian. The max width specifies | ||
| how large the width of the bounds can be across the antimeridian. For example | ||
| bounds with xmin=-176, xmax=170 has a width of 14 degrees across the antimeridian. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| bounds with xmin=-176, xmax=170 has a width of 14 degrees across the antimeridian. | |
| a set of bounds with xmin=-176, xmax=170 has a width of 14 degrees across the antimeridian. |
| how large the width of the bounds can be across the antimeridian. For example | ||
| bounds with xmin=-176, xmax=170 has a width of 14 degrees across the antimeridian. | ||
| The same bounds would stretch 346 degrees across the globe if an antimeridian crossing | ||
| if not considered. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if not considered. | |
| is not considered. |
| the set of bounds (xmin, ymin, xmax, ymax) | ||
| max_scene_width : int, optional | ||
| maximum allowable width of the scene bounds in degrees, by default 20 | ||
| The set of bounds (xmin, ymin, xmax, ym : in_degrees, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| The set of bounds (xmin, ymin, xmax, ym : in_degrees, | |
| The set of bounds (xmin, ymin, xmax, ymax : in_degrees, |
|
|
||
| print(bounds) | ||
| >>> (-178.03, -71.61, 173.43, -68.76) | ||
| # bounds represent the eastern and western most point either side of the antimeridian |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # bounds represent the eastern and western most point either side of the antimeridian | |
| # bounds represent the eastern-most and western-most point either side of the antimeridian |