1

I want to download Sentinel-1 SAR data for both VV and VH with IW only within a rectangular polygon? I could download with the ROI, but even though ROI is a rectangle, the output to export is a rectangle.

ROI I selected square output I'm getting

The red rectangle is my ROI, but it's taking the extreme coordinates and making a square that encloses the ROI and exporting that output as shown.

I only want the data inside the ROI.

I even tried to use ee.Image.clip. But I couldn't able to comeup with a solution which can download the data. It was going to a large file

var start_date = ee.Date('2019-05-01');
finish_date = ee.Date('2019-06-15');
var orbit = 'ASCENDING';

var collectionS1 = ee.ImageCollection('COPERNICUS/S1_GRD')
    .filter(ee.Filter.listContains('transmitterReceiverPolarisation', 'VV'))
    .filter(ee.Filter.eq('instrumentMode', 'IW'))
    // .filter(ee.Filter.eq('orbitProperties_pass', orbit))
    .filterDate(start_date, finish_date)
    //.filterBounds(polygons);

 // Get the VV collection.
var collectionVV = collectionS1.select('VV');
// Get the VH collection.
var collectionVH = collectionS1.select('VH');

var VV = ee.Image(collectionVV.first().clip(roi_A);  //roi_A is my rectangular roi
var VH = ee.Image(collectionVH.first()); 

// I would like to take VV and VH and stack them and download
var VVVH = VV.addBands(VH)

Export.image.toDrive({
  image: VV,
  description: 'A_ERT',
  scale: 10,
  //region: ROI,
  fileFormat: 'GeoTIFF',
  //formatOptions: {
  //  cloudOptimized: true
  //}
});

I'm getting the following error message.

Error: Export too large: specified 6875185131 pixels (max: 100000000). Specify higher maxPixels value if you intend to export a large area.

6
  • 1
    If you want to mask out the pixels that don't fall within the geometry, that would be a different operation, but rasters are always clipped by the minimum bounding rectangle (MBR).
    – Vince
    Dec 20, 2020 at 14:47
  • So why didn't .clip() work for you?
    – JonasV
    Dec 20, 2020 at 14:49
  • @JonasV. after clipping, I couldn't download it. it's going to a large file. Dec 20, 2020 at 15:12
  • @Vince. Do you have a working code? Dec 20, 2020 at 15:12
  • @JonasV: The following is the error message: Error: Export too large: specified 6875185131 pixels (max: 100000000). Specify higher maxPixels value if you intend to export a large area. Dec 21, 2020 at 4:31

1 Answer 1

0

you only applied the clip to VV collection but not for VH. Maybe apply it after you stack both band on each other:

var VVVH = VV.addBands(VH).clip(ROI)

Regarding the max pixel error. Try to use: maxPixels:1e13 in your export. Its the most pixels you can use in an export.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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