Google Earth Engine – Can Features Be Exported to Asset Folder in Google Earth Engine?

google-earth-enginegoogle-earth-engine-javascript-api

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

Best Answer

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.)

Related Question