When I create a collection (named here geeCol) using Google Earth Engine, the projection displayed by geeCol.first().projection().getInfo() returns:
{'type': 'Projection', 'crs': 'EPSG:4326', 'transform': [0.25, 0.0, -180.0, 0.0, -0.25, 90.0]}
Based on this thread, I wrote a function that takes the average of multiple images within a time defined in days:
def makeComposite(collection, start, count, interval, units):
sequence = ee.List.sequence(0, ee.Number(count).subtract(1)) # Create a sequence of numbers, one for each time interval.
originalStartDate = ee.Date(start) # Original start date
def col(i):
startDate = originalStartDate.advance(ee.Number(interval).multiply(i), units)
# Get the end date of the current sequence.
endDate = originalStartDate.advance(ee.Number(interval).multiply(ee.Number(i).add(1)), units)
return collection.filterDate(startDate, endDate).reduce(ee.Reducer.mean())
return ee.ImageCollection(sequence.map(col))
When I map this function on to my collection, the new projection is:
{'type': 'Projection', 'crs': 'EPSG:4326', 'transform': [1.0, 0.0, 0.0, 0.0, 1.0, 0.0]}
Since 'crs' is preserved but 'transform' is changed, I am wondering if:
- This discrepancy really matters when I export my data to a csv
- If it does, what is the appropriate way of redefining the 'transform' field of the projection? Since the function does not appear to truly change the projection, is it a matter of (i) using
image.reproject()or (ii)image.setDefaultProjection()?
In other terms, I am unsure whether it is a matter of re-projecting the entire image or just to correct a field that was lost.