Spaces:
Runtime error
Runtime error
Commit
·
17ef3ec
1
Parent(s):
7d961bb
fix get image
Browse files- biomap/utils_gee.py +1 -3
biomap/utils_gee.py
CHANGED
|
@@ -12,7 +12,7 @@ service_account = '[email protected]'
|
|
| 12 |
credentials = ee.ServiceAccountCredentials(service_account, os.path.join(os.path.dirname(__file__), '.private-key.json'))
|
| 13 |
ee.Initialize(credentials)
|
| 14 |
|
| 15 |
-
def
|
| 16 |
logging.info(f"getting image for {d1} to {d2} at location {location}")
|
| 17 |
img = extract_img(location, d1, d2)
|
| 18 |
|
|
@@ -145,9 +145,7 @@ def extract_img(location,start_date,end_date, width = 0.01 , len = 0.01,scale=5)
|
|
| 145 |
"""
|
| 146 |
ee_img, geometry = extract_ee_img(location, width,start_date,end_date , len)
|
| 147 |
url = get_url(ee_img, geometry, scale)
|
| 148 |
-
logging.info(f"got url image for {start_date} to {end_date}")
|
| 149 |
img = extract_np_from_url(url)
|
| 150 |
-
logging.info(f"Downloaded image for {start_date} to {end_date}")
|
| 151 |
|
| 152 |
return img
|
| 153 |
|
|
|
|
| 12 |
credentials = ee.ServiceAccountCredentials(service_account, os.path.join(os.path.dirname(__file__), '.private-key.json'))
|
| 13 |
ee.Initialize(credentials)
|
| 14 |
|
| 15 |
+
def get_image(location, d1, d2):
|
| 16 |
logging.info(f"getting image for {d1} to {d2} at location {location}")
|
| 17 |
img = extract_img(location, d1, d2)
|
| 18 |
|
|
|
|
| 145 |
"""
|
| 146 |
ee_img, geometry = extract_ee_img(location, width,start_date,end_date , len)
|
| 147 |
url = get_url(ee_img, geometry, scale)
|
|
|
|
| 148 |
img = extract_np_from_url(url)
|
|
|
|
| 149 |
|
| 150 |
return img
|
| 151 |
|