Skip to content
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

Remove CONUS/AK Search Constraint (cryocloud dev) #10

Merged
merged 6 commits into from
Oct 17, 2024
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/coincident/search/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def _validate_spatial_bounds(
intersects: gpd.GeoSeries,
) -> None:
"""
Validate that the specified area of interest (AOI) within CONUS or Alaska.
Validate that the specified area of interest (AOI) is type GeoDataFrame or GeoSeries
Parameters
----------
dataset : _Dataset
Expand All @@ -181,7 +181,7 @@ def _validate_spatial_bounds(
Raises
------
ValueError
If the AOI is not within the bounds of the Continental U.S. or Alaska.
If the AOI is not type GeoDataFrame or GeoSeries
"""
if not isinstance(intersects, gpd.GeoDataFrame | gpd.GeoSeries):
message = f"intersects value must be a GeoDataFrame or GeoSeries, not {type(intersects)}"
Expand All @@ -191,10 +191,10 @@ def _validate_spatial_bounds(
raise ValueError(message)

# NOTE: use geopandas to first convert to projected CRS?
aoi = intersects.to_crs("EPSG:4326").geometry.iloc[0] # shapely geometry
CONUS = box(*(-124.84, 24.39, -66.88, 49.38))
AK = box(*(-179.99, 51.21, -129.63, 71.35))
if not aoi.within(CONUS) and not aoi.within(AK):
message = "Requested search polygon not within Continental U.S. or Alaska"
raise ValueError(message)
#aoi = intersects.to_crs("EPSG:4326").geometry.iloc[0] # shapely geometry
#CONUS = box(*(-124.84, 24.39, -66.88, 49.38))
#AK = box(*(-179.99, 51.21, -129.63, 71.35))
#if not aoi.within(CONUS) and not aoi.within(AK):
# message = "Requested search polygon not within Continental U.S. or Alaska"
# raise ValueError(message)
Copy link
Member

Choose a reason for hiding this comment

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

Go ahead and delete this rather than comment out

# warnings.warn(f'Requested search polygon not within Continental U.S. or Alaska')
Loading