validating primitives

Check the distribution of your sampling points.

step 1:  Change the code below to validate your primitives

var chl = ee.FeatureCollection("users/servirmekong/Vietnam/CHL_Boundary").geometry();

var plantations = ee.Image("users/servirmekong/Vietnam/primitives/plantations").rename('plantations')
var forest = ee.Image("users/servirmekong/Vietnam/primitives/forest").rename('forest')
var cropland = ee.Image("users/servirmekong/Vietnam/primitives/cropland").rename('cropland')
var urban = ee.Image("users/servirmekong/Vietnam/primitives/urban").rename('settlement')
var water = ee.Image("users/servirmekong/Vietnam/primitives/water").rename('water')
var plantations = ee.Image("users/servirmekong/Vietnam/primitives/plantations").rename('plantations');
var forest = ee.Image("users/servirmekong/Vietnam/primitives/forest").rename('forest');
var cropland = ee.Image("users/servirmekong/Vietnam/primitives/cropland").rename('cropland');
var urban = ee.Image("users/servirmekong/Vietnam/primitives/urban").rename('settlement');
var water = ee.Image("users/servirmekong/Vietnam/primitives/water").rename('water');

// Pre-define some customization options.
var options = {
  title: 'histogram',
  fontSize: 12,
  hAxis: {title: 'probability (%)'},
  vAxis: {title: 'count'},
};

// add the reference data
var referenceData = ee.FeatureCollection("users/servirmekong/Vietnam/ReferenceDataForestTraining");

// filter reference data
var waterPoints = referenceData.filter(ee.Filter.eq("land_type","water"));
var cropPoints = referenceData.filter(ee.Filter.eq("land_type","crop"));
var urbanPoints = referenceData.filter(ee.Filter.eq("land_type","urban"));
var plantationsPoints = referenceData.filter(ee.Filter.eq("land_type","plantations"));
var forestPoints = referenceData.filter(ee.Filter.eq("land_type","forest"));

var otherPoints =  referenceData.filter(ee.Filter.neq("land_type","water"));

print(ui.Chart.image.histogram(water, waterPoints).setOptions(options))
print(ui.Chart.image.histogram(water, otherPoints).setOptions(options))

 

follow this link

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s