How to download sentinel 1 for a particular polygon from Google Earth Engine

Viewed 679

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.

1 Answers

At first, have a look at the guide here: https://developers.google.com/earth-engine/guides/exporting

There are multiple ways to go about this in Export.image.toDrive:

  1. specify a region - create geometry and specify its name in the export (f.ex. region: geometry)
  2. if exporting large scale images - reduce the scale (f.ex. scale: 20)
  3. in case you really want the full resolution for your region - add "maxPixels:" to your export and increase the value as specified in the guide I linked above (f.ex. maxPixels: 1e10)

To speed up your workflow also filter data in your imageCollection to your geometry by adding .filterBounds(geometry)

Related