0

I'm using Google Earth Engine Python API in Jupyter. I'm working with an ImageCollection from Sentinel 2 Surface Reflectance dataset for a given area on a single day and filtering by a region of interest (roi) polygon.

The ImageCollection only contains 2 images and one of these appears to be in a different CRS (EPSG: 32631) the other being in the expected EPSG: 4326. This is causing problems for further processing. The code for creating the image collection is:

roi = ee.Geometry.Polygon(
[[[3.94, 51.6],
    [5.3, 51.6],
    [5.3, 52.15],
    [3.94, 52.15],
    [3.94, 51.6]]], None, False)


dataset = ee.ImageCollection("COPERNICUS/S2_SR")\
    .filterDate('2020-04-20', '2020-04-21')\
    .filterBounds(roi)

Here is an screenshot of the collection in Jupyter:

enter image description here

I have two questions:
1. How can I ensure all images in a collection are in the same CRS (and what is the most robust method for achieving this)?
2. Why are images from one dataset in different CRSs?

1

How are you checking which CRS the two images have? To me, both seems to be EPSG: 32631:

roi = ee.Geometry.Polygon(
[[[3.94, 51.6],
    [5.3, 51.6],
    [5.3, 52.15],
    [3.94, 52.15],
    [3.94, 51.6]]], None, False)


dataset = ee.ImageCollection("COPERNICUS/S2_SR")\
    .filterDate('2020-04-20', '2020-04-21')\
    .filterBounds(roi)


list = dataset.toList(2)    
i1 = ee.Image(list.get(0))
i2 = ee.Image(list.get(1))

print(i1.select(0).projection().crs().getInfo())
print(i2.select(0).projection().crs().getInfo())
| improve this answer | |
  • I've tried to merge the images with dataset.toBands() in order to export. When I try to export I keep running into the error: Image.projection: The bands of the specified image contains different projections. Use Image.select to pick a single band. But yes, you're right. it looks like they are the same CRS – Oliver Burdekin May 11 at 14:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.