Calculating area by classified image in earth engineExporting a classified map from google earth...
Is the percentage symbol a constant?
Can someone explain what a key is?
Do the speed limit reductions due to pollution also apply to electric cars in France?
How do I avoid the "chosen hero" feeling?
Why does this quiz question say that protons and electrons do not combine to form neutrons?
Does しかたない imply disappointment?
Missing a connection and don't have money to book next flight
How do I narratively explain how in-game circumstances do not mechanically allow a PC to instantly kill an NPC?
How does holding onto an active but un-used credit card affect your ability to get a loan?
Taking an academic pseudonym?
Did ancient Germans take pride in leaving the land untouched?
When does a person lose diplomatic status?
Converting numbers to words - Python
In a post apocalypse world, with no power and few survivors, would Satnav still work?
Cartoon in which kids compete by fighting as monsters or creatures with special powers in a virtual world
Reason for small-valued feedback resistors in low noise Op Amp
Boss asked me to sign a resignation paper without a date on it along with my new contract
Why write a book when there's a movie in my head?
Partial derivative with respect to three variables
Buying a "Used" Router
Is the tritone (A4 / d5) still banned in Roman Catholic music?
Isn't a semicolon (';') needed after a function declaration in C++?
Is Screenshot Time-tracking Common?
Expression for "unconsciously using words (or accents) used by a person you often talk with or listen to"?
Calculating area by classified image in earth engine
Exporting a classified map from google earth engineSampling Image collection google earth engineCalculating cost distance in Google Earth Engine?Calculating areas of different classes in Google Earth Engine?Area error in Google Earth EngineDifferences in Area calculation methods Google Earth Engine?Get image names from image collection in Google Earth EngineGoogle Earth Engine, how to distinguish between rivers/streams and ponds/lakes in a water maskGoogle Earth Engine code for calculating NDWI from sentinel 2 image collection?Clipping classified image by shapefile in Google Earth Engine
I want to calculate the area for each classified color in earth engine.
Here are my codes.
var image = ee.Image(ee.ImageCollection('LANDSAT/LC8_L1T_TOA')
.filterBounds(roi)
.filterDate('2015-01-01', '2015-12-31')
.sort('CLOUD_COVER')
.first());
print(image);
Map.addLayer(image, {bands: ['B4', 'B3', 'B2'], max: 0.3}, 'image_L8');
var clip = image.clip(table); //cliping image to shapefile
var newclassified =
vegetation.merge(water).merge(agri_bare).merge(builtarea);
print(newclassified);
var bands = ['B2', 'B3', 'B4', 'B5', 'B6', 'B7', 'B10', 'B11'];
var training = clip.select(bands).sampleRegions({
collection: newclassified,
properties: ['landcover'],
scale: 30
});
var classifier = ee.Classifier.cart().train({
features: training,
classProperty: 'landcover',
inputProperties: bands
});
var classified = clip.select(bands).classify(classifier);
Map.centerObject(newclassified, 11);
Map.addLayer(clip,
{bands: ['B4', 'B3', 'B2'], max: 0.4},
'Landsat image');
Map.addLayer(classified,
{min: 1, max: 4, palette: ['green', 'blue', 'yellow', 'red']},
'classification');
Now I want to calculate the area covered by green, blue, yellow and red palette.
What code I required to do that??
google-earth-engine area
add a comment |
I want to calculate the area for each classified color in earth engine.
Here are my codes.
var image = ee.Image(ee.ImageCollection('LANDSAT/LC8_L1T_TOA')
.filterBounds(roi)
.filterDate('2015-01-01', '2015-12-31')
.sort('CLOUD_COVER')
.first());
print(image);
Map.addLayer(image, {bands: ['B4', 'B3', 'B2'], max: 0.3}, 'image_L8');
var clip = image.clip(table); //cliping image to shapefile
var newclassified =
vegetation.merge(water).merge(agri_bare).merge(builtarea);
print(newclassified);
var bands = ['B2', 'B3', 'B4', 'B5', 'B6', 'B7', 'B10', 'B11'];
var training = clip.select(bands).sampleRegions({
collection: newclassified,
properties: ['landcover'],
scale: 30
});
var classifier = ee.Classifier.cart().train({
features: training,
classProperty: 'landcover',
inputProperties: bands
});
var classified = clip.select(bands).classify(classifier);
Map.centerObject(newclassified, 11);
Map.addLayer(clip,
{bands: ['B4', 'B3', 'B2'], max: 0.4},
'Landsat image');
Map.addLayer(classified,
{min: 1, max: 4, palette: ['green', 'blue', 'yellow', 'red']},
'classification');
Now I want to calculate the area covered by green, blue, yellow and red palette.
What code I required to do that??
google-earth-engine area
add a comment |
I want to calculate the area for each classified color in earth engine.
Here are my codes.
var image = ee.Image(ee.ImageCollection('LANDSAT/LC8_L1T_TOA')
.filterBounds(roi)
.filterDate('2015-01-01', '2015-12-31')
.sort('CLOUD_COVER')
.first());
print(image);
Map.addLayer(image, {bands: ['B4', 'B3', 'B2'], max: 0.3}, 'image_L8');
var clip = image.clip(table); //cliping image to shapefile
var newclassified =
vegetation.merge(water).merge(agri_bare).merge(builtarea);
print(newclassified);
var bands = ['B2', 'B3', 'B4', 'B5', 'B6', 'B7', 'B10', 'B11'];
var training = clip.select(bands).sampleRegions({
collection: newclassified,
properties: ['landcover'],
scale: 30
});
var classifier = ee.Classifier.cart().train({
features: training,
classProperty: 'landcover',
inputProperties: bands
});
var classified = clip.select(bands).classify(classifier);
Map.centerObject(newclassified, 11);
Map.addLayer(clip,
{bands: ['B4', 'B3', 'B2'], max: 0.4},
'Landsat image');
Map.addLayer(classified,
{min: 1, max: 4, palette: ['green', 'blue', 'yellow', 'red']},
'classification');
Now I want to calculate the area covered by green, blue, yellow and red palette.
What code I required to do that??
google-earth-engine area
I want to calculate the area for each classified color in earth engine.
Here are my codes.
var image = ee.Image(ee.ImageCollection('LANDSAT/LC8_L1T_TOA')
.filterBounds(roi)
.filterDate('2015-01-01', '2015-12-31')
.sort('CLOUD_COVER')
.first());
print(image);
Map.addLayer(image, {bands: ['B4', 'B3', 'B2'], max: 0.3}, 'image_L8');
var clip = image.clip(table); //cliping image to shapefile
var newclassified =
vegetation.merge(water).merge(agri_bare).merge(builtarea);
print(newclassified);
var bands = ['B2', 'B3', 'B4', 'B5', 'B6', 'B7', 'B10', 'B11'];
var training = clip.select(bands).sampleRegions({
collection: newclassified,
properties: ['landcover'],
scale: 30
});
var classifier = ee.Classifier.cart().train({
features: training,
classProperty: 'landcover',
inputProperties: bands
});
var classified = clip.select(bands).classify(classifier);
Map.centerObject(newclassified, 11);
Map.addLayer(clip,
{bands: ['B4', 'B3', 'B2'], max: 0.4},
'Landsat image');
Map.addLayer(classified,
{min: 1, max: 4, palette: ['green', 'blue', 'yellow', 'red']},
'classification');
Now I want to calculate the area covered by green, blue, yellow and red palette.
What code I required to do that??
google-earth-engine area
google-earth-engine area
asked 4 mins ago
Sourav KarmakarSourav Karmakar
84
84
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "79"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f313288%2fcalculating-area-by-classified-image-in-earth-engine%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Geographic Information Systems Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f313288%2fcalculating-area-by-classified-image-in-earth-engine%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown