Skip to content

Conversation

@abradley60
Copy link
Collaborator

  • 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.

Copy link
Collaborator

@caitlinadams caitlinadams left a 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)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
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)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
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.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
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.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
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,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
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
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# 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

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.

2 participants