From 7891894317736ce2f087ae62d57264900ca0edd1 Mon Sep 17 00:00:00 2001 From: micah johnson Date: Thu, 1 Aug 2024 14:37:18 -0600 Subject: [PATCH] A bit of clean up --- snowexsql/api.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/snowexsql/api.py b/snowexsql/api.py index 51bb9f6..d38c4d1 100644 --- a/snowexsql/api.py +++ b/snowexsql/api.py @@ -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: