Springe direkt zu Inhalt

Assets

assetts1

assetts1

You may also easily import your own image- or table data to use it in the Google Earth Engine.

To do so, navigate to 'Assets' in the top left Panel and click on the button 'NEW'.

Here, choose either 'Image Upload' if you want to upload a raster image or 'Table Upload' if you want to upload Shapefiles or CSV-tables.

Follow the instructions in the popup-window. You can also change the assets root directory and ID, as well as some basic properties here.

When you are done, click on 'Upload' to upload your data to the Google Earth Engine.

 

The progress of your upload will be noted in the 'Tasks' tab of the top right Panel.

As soon as the upload is done, your data will be listed in the 'Assets' tab. Should this not be the case, try clickling the 'Refresh' button right next to the 'NEW' button.

Clicking the list entry of your data will yield more specific information, like its Table ID, its location and the number of features for shapefiles.

To import your asset into your script, you can either:

- Access it the same way you access data from the GEE by adressing its root directory.

- Click on the assets entry, then 'Import' in the popup-window.

- Hover over the assets entry, then click the third icon on the right 'Import into script'.

 

At this point, you can work with your own asset exactly like you would with any other geometry-feature or satellite image.

//Access the root directory of your uploaded asset.
var asset = ee.FeatureCollection("users/yourdirectoryname/thenameofyouruploadedasset");

//This could for example look like this:
var extent_aoi = ee.FeatureCollection("users/lucasb/shapefile_berlin");

//Print your asset to the Console
print(asset, 'Asset');

//Visualize your asset in the Map Panel
Map.addLayer(asset, {}, 'Asset');

Exporting data to your Assets

You may also export data you created to your Assets. The point of doing this is that you can easily and quickly use this data in any project you are working with, without having to add the processing chain to your script, saving both computing time and script clarity. This can be essentially useful if you have a finished product that is needed for future research steps or presentational purposes.

To do so, you can simply use the Export.image or Export.table, depending on your type of data. Check the category Export in the Docs tab to find out more about its individual configuration parameters.

Let us now add a smaller subset of the image s2_mean we created in the previous step to our assets. First, add the the following code to your script and run it. The Tasks tab is now highlighted in orange. Click on it to find the unsubmitted task 'Sentinel2MeanImage' in the tasks manager. Now, you only need to hit RUN right next to it, adjust some fine attunement if you want to and confirm to have your data added to your assets. Don't forget to refresh your Assets, as it may not be listed automatically!

//create a subset geometry
var s2_mean_subset = ee.Geometry.Polygon(
        [[[35.83717612572737, 33.79008871915932],
          [35.83717612572737, 33.72986315846921],
          [35.924380105219555, 33.72986315846921],
          [35.924380105219555, 33.79008871915932]]], null, false);

// Export the subset of the previously created image s2_mean to your assets.
Export.image.toAsset({
  image: s2_mean,
  description: 'Sentinel2MeanImage',
  assetId: 's2_mean',
  scale: 30,
  region: s2_mean_subset
});