Skip to content

Commit

Permalink
updated CONUS/AK (not sure why my branch didn't have this already) an…
Browse files Browse the repository at this point in the history
…d win-64 compat
  • Loading branch information
Jack-Hayes committed Oct 16, 2024
1 parent e5a70a4 commit fe707f6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ messages_control.disable = [

[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["osx-arm64", "linux-64"]
platforms = ["osx-arm64", "linux-64", "win-64"]

[tool.pixi.environments]
default = { solve-group = "default" }
Expand Down
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)
# warnings.warn(f'Requested search polygon not within Continental U.S. or Alaska')

0 comments on commit fe707f6

Please sign in to comment.