I'm using Earth Engine with Python, and while I finally managed to find an answer here that helped me troubleshoot my problem, I am not sure why it worked, and that makes me concerned that I may be misunderstanding some core element of the EE object that will come to bite me in the ass further down the line.
So here is my homegrown, non functional code:
pt = coords[1]
point = ee.Geometry.Point([pt[0], pt[1]])
start = ee.Date(pt[2])
finish = ee.Date(pt[3])
band_arrs = ee.ImageCollection('LANDSAT/LC08/C01/T1') \
.filterBounds(point) \
.filterDate(start, finish).toBands()
band_arr_b4 = band_arrs.get('B4')
band_arr_b5 = band_arrs.get('B5')
band_arr_b6 = band_arrs.get('B6')
np_arr_b4 = np.array(band_arr_b4.getInfo())
np_arr_b5 = np.array(band_arr_b5.getInfo())
np_arr_b6 = np.array(band_arr_b6.getInfo())
feature = ee.Feature(ee.Geometry.Point([pt[0], pt[1]]));
band_arr_b6.getInfo()
this code returns a correct image object, but attempting to get any of the bands returns a None object. Casting to a feature did not help either, though I imagine that was to be expeced.
and here is the code I got and modified from this link that does work:
region = ee.Geometry.Point([37.3634, 8.8481])
image = ee.ImageCollection("LANDSAT/LC08/C01/T1").filterBounds(region).filterDate('2019-01-01', '2019-02-28').first()
imagereduce = image.reduceRegion(**{
'reducer': ee.Reducer.toList(),
'geometry': region,
'scale': 30
})
print(imagereduce.get('B1').getInfo())
Does this mean that the image object doesn't carry any band information and only carries metadata? Is the reduction a necessary element, or is it that I'm trying to achieve an outcome with EE that is counter-intuitive? My ultimate goal with this is to extract band information for a series of points of interests. Is there a better way to achieve that than looping through every point via this method?