Skip to content

morandiaye/GEE_Feature_Collection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

GEE_Feature_Collection

1. Import feature colection

This feature is made up of department of senegal

var departement = ee.FeatureCollection("users/ndmorndiaye/senegal_dep");

2. Make function to compute area in km2

// add area of department km2
var sup=function(feature){
  return ee.Feature(feature).set({areaha:feature.geometry().area().divide(1000*1000)
})};

3. Spread function in all feature collection

// Spread on all feature in collection feature feature
var dep_new=departement.map(sup);
// take a look in change i made
print("new departement",dep_new);

4. Add Centroids in the feature collection : departement

var centroid=function(feature){
  var prop=["DEPT","REG","STATUT","areaha"]
  return ee.Feature(feature.geometry().centroid()).copyProperties(feature,prop)
};

5. Applicate function over all feature in dep_new

// Applicate the fuction in all fearture collection
var dep_centroids=dep_new.map(centroid);
print("centroids:",dep_centroids);

6. Data vizualization

Map.centerObject(departement,6)
Map.addLayer(ee.Image().paint(departement,"black",1),{},"Limit Department")
Map.addLayer(dep_centroids,{},"departement centroids");

link:earth engine link

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published