2

I'm trying to perform classification on a large study area and would like to store the features of the study area in the Asset folder of Google Earth Engine, so that it becomes easy for me to call the same features in other program files. Can we do that?

As per the Exporting Data, images can be exported to Asset, but I cannot find any information regarding saving the features to asset.

This is the code for the study area. Please note that I want to export 'combined_fearure' to the asset folder.

var admin2 = ee.FeatureCollection("FAO/GAUL_SIMPLIFIED_500m/2015/level2");
var mh = admin2.filter(ee.Filter.eq('ADM1_NAME', 'Maharashtra'))

var visParams = {'color': 'red'}
Map.addLayer(mh, visParams, 'MH Districts')

var combined_feature = mh.merge(dahej)  // total study area

var visParams = {'color': 'blue'}
Map.addLayer(combined_feature, visParams, 'Combined Districts')

// Importing Image collection
var s2 = ee.ImageCollection("COPERNICUS/S2_SR")

Map.centerObject(combined_feature,12)

var rgbVis = {
  min: 0.0,
  max: 3000,
  bands: ['B4', 'B3', 'B2'],
};

var bands = ['B2', 'B3', 'B4']

var filtered = s2
.filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE', 10))
  .filter(ee.Filter.date('2021-01-01', '2021-12-31'))
  .filter(ee.Filter.bounds(combined_feature))
  //.map(maskS2clouds)
  .select(bands);
  
var composite = filtered.median().clip(combined_feature)

print(filtered)

// Display the input composite.
Map.addLayer(composite, rgbVis, 'image');

Here is the code

1 Answer 1

3

In the context of assets, feature collections are known as “tables”. You're looking for Export.table.toAsset() (also mentioned in the guide here).

(Why there are different terms: An ee.FeatureCollection is more general than a table asset because it can contain images (in fact, an ImageCollection is a special kind of FeatureCollection), other collections, and various other sorts of complex structures that can't necessarily be exported. A table asset specifically only contains geometry and simple data properties like strings and numbers.)

1
  • Thank you for the guide. I had missed that part
    – Learner
    Apr 2 at 16:23

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.