0

I have a question regarding exporting a data from GEE. I am new to coding and GEE. What I would like to achieve is export pixel band data of points a have managed to upload using Fusion Table. Is is possible for GEE to export band data of those point in form of a table?

My code so far: https://code.earthengine.google.com/8a764b5d22a9f7108152fce1acc1fe16

The code:

// Load a FeatureCollection from a Fusion Table
var CRuHM_small_data = ee.FeatureCollection('ft:1ocXhbAqP_NbA0iE7tivKgKCfTFGseNdibklZj0NX');

// Print and display the FeatureCollection.
Map.addLayer(CRuHM_small_data,{},'CRuHM_small_data');
print(CRuHM_small_data);

//Navigate to area of interest
Map.setCenter(17.3834, -0.8929, 8);

// Select a specific Sentinel-2 image from the archive
var sent2a = ee.Image("COPERNICUS/S2/20170801T090021_20170801T091620_T33MYV");

// Add RGB composite to map, for water/land
Map.addLayer(sent2a,{bands:['B8','B11','B4'], min:0, max:3000}, "water/land");

However, the next step is more complicated for me. 
I was trying this code, but something is missing:(

//exporting band data to table
//Export.table.toDrive(collection, description, folder, 
//fileNamePrefix, fileFormat, selectors),

Export.table.toDrive({
  collection: CRuHM_small_Data,
  description: "CRuHM_small_Data",
  folder: "GEE",
  fileNamePrefix: "Table",
  fileFormat: "CSV",
  selectors: ["ID", "B3", "B2"]
  });
  • Welcome to GIS SE. As a new user, please take the Tour. Coding questions are expected to contain code. While a link to a more involved example might be useful, we need to actual code in the question, because links fail over time, and asking volunteers to follow links doesn't result in an increased response rate. – Vince Mar 31 at 14:01
  • Thank you for editing my post. How did post the code in separate window? – jakubsz Mar 31 at 14:43
  • Use the {} button to indent all code four spaces. SE does the rest. – Vince Mar 31 at 14:57
0

I have found the sulution.

// Print and display the FeatureCollection.
 Map.addLayer(survey_points,{color:'red'},'survey_points');
print(survey_points);

//Navigate to area of interest
Map.setCenter(17.3834, -0.8929, 8);

// Select a specific Sentinel-2 image from the archive
var sent2a = ee.Image("COPERNICUS/S2/20170801T090021_20170801T091620_T33MYV");


//sampleRegions(collection, properties, scale, projection, tileScale, geometries)

var pixelsID = sent2a.sampleRegions(survey_points, ['ID', 'Depth'], 10);

print(pixelsID)

//Export table toDrive

Export.table.toDrive({
  collection: pixelsID,
  description: "pixelsID",
  folder: "GEE",
  fileNamePrefix: "Calibration_Band_Values",
  fileFormat: "CSV",
  selectors: ["ID",'Depth', "B2", "B2",]
  });

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.