Skip to content

Commit

Permalink
A bit of clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
micahjohnson150 committed Aug 1, 2024
1 parent d8e7726 commit 7891894
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions snowexsql/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,19 +427,13 @@ def from_area(cls, shp=None, pt=None, buffer=None, crs=26912, **kwargs):
# Find all the tiles that
q = q.filter(gfunc.ST_Intersects(ImageData.raster, db_shp))

# Query upfront except for the limit

limit = kwargs.get("limit")
if limit:
kwargs.pop("limit")
q = cls.extend_qry(q, check_size=False, **kwargs)

# Execute the query
# Check the query size or limit the query
if limit:
q = cls.extend_qry(q, limit=limit)
else:
cls._check_size(qry, kwargs)
rasters = q.all()

# Get the rasterio object of the raster
datasets = raster_to_rasterio(rasters)
if len(datasets) > 0:
Expand Down

0 comments on commit 7891894

Please sign in to comment.