0% found this document useful (0 votes)
7 views2 pages

Land Use Classification in Chennai 2000-2024

The document contains JavaScript code for analyzing land use and land cover (LULC) changes in Chennai between the years 2000 and 2024 using satellite imagery. It defines training polygons for different land classes, processes Landsat 7 and Sentinel-2 images, and trains classifiers to classify land cover types. Finally, it visualizes the results on side-by-side maps and includes a legend for interpretation.

Uploaded by

deepucsd24oct
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

Land Use Classification in Chennai 2000-2024

The document contains JavaScript code for analyzing land use and land cover (LULC) changes in Chennai between the years 2000 and 2024 using satellite imagery. It defines training polygons for different land classes, processes Landsat 7 and Sentinel-2 images, and trains classifiers to classify land cover types. Finally, it visualizes the results on side-by-side maps and includes a legend for interpretation.

Uploaded by

deepucsd24oct
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CODE USED: javascript

// ----------------------------- // STUDY AREA // -----------------------------

var chennai = [Link]([80.27, 13.08]).buffer(30000);

// ----------------------------- //

TRAINING POLYGONS (2000)

// -----------------------------

var water2000 = [Link](func on(f){ return [Link]('class', 0); });

var builtup2000 = [Link](func on(f){ return [Link]('class', 1); });

var veg2000 = [Link](func on(f){ return [Link]('class', 2); });

var barren2000 = [Link](func on(f){ return [Link]('class', 3); }); var

training2000Polygons = water2000 .merge(builtup2000) .merge(veg2000)

.merge(barren2000);

// ----------------------------- // TRAINING POLYGONS (2024) // -----------------------------

var water2024 = [Link](func on(f){ return [Link]('class', 0); });

var builtup2024 = [Link](func on(f){ return [Link]('class', 1); });

var veg2024 = [Link](func on(f){ return [Link]('class', 2); }); var barren2024 =

[Link](func on(f){ return [Link]('class', 3); });

var training2024Polygons = water2024 .merge(builtup2024) .merge(veg2024)

.merge(barren2024);

// ----------------------------- // LANDSAT 7 SR (2000) // -----------------------------

var l7 = [Link] on("LANDSAT/LE07/C02/T1_L2") .filterBounds(chennai)

.filterDate('2000-01-01', '2000-12-31') .map(func on(img) { return

[Link] ply(0.0000275).add(-0.2) // scale reflectance

.select(['SR_B1','SR_B2','SR_B3','SR_B4'], ['Blue','Green','Red','NIR']); }) .median();

// ----------------------------- // SENTINEL-2 SR (2024) // -----------------------------

var s2 = [Link] on("COPERNICUS/S2_SR") .filterBounds(chennai)

.filterDate('2024-01-01', '2024-12-31') .map(func on(img){ return

[Link](['B2','B3','B4','B8'], ['Blue','Green','Red','NIR']); }) .median();

// ----------------------------- // SAMPLE TRAINING POINTS // -----------------------------

var training2000 = [Link]({ collec on: training2000Polygons, proper es:

['class'], scale: 30 }); var training2024 = [Link]({ collec on:

training2024Polygons, proper es: ['class'], scale: 10 });

// ----------------------------- // TRAIN CLASSIFIERS // -----------------------------


var classifier2000 = [Link]fi[Link](50).train({ features:

training2000, classProperty: 'class', inputProper es: ['Blue','Green','Red','NIR'] });

var classifier2024 = [Link]fi[Link](50).train({ features:

training2024, classProperty: 'class', inputProper es: ['Blue','Green','Red','NIR'] });

// ----------------------------- // CLASSIFY // -----------------------------

var lulc2000 = [Link](classifier2000); var lulc2024 = [Link](classifier2024);

// ----------------------------- // VISUALIZATION // -----------------------------

var pale e = [ '0000ff', // 0 = water (blue) 'ff0000', // 1 = builtup (red) '00ff00', // 2 =

vegeta on (green) 'ffff00' // 3 = barren (yellow) ];

// ----------------------------- // SIDE-BY-SIDE MAPS // -----------------------------

var map2000 = [Link](); var map2024 = [Link](); [Link](chennai,

10); [Link](chennai, 10); [Link](lulc2000, {min:0, max:3,

pale e: pale e}, 'LULC 2000'); [Link](lulc2024, {min:0, max:3, pale e:

pale e}, 'LULC 2024'); // Titles [Link]([Link]('LULC 2000', {posi on: 'top-

center', fontWeight: 'bold', fontSize: '14px'})); [Link]([Link]('LULC 2024',

{posi on: 'top-center', fontWeight: 'bold', fontSize: '14px'}));

// Create SplitPanel

var splitPanel = [Link]({ firstPanel: map2000, secondPanel: map2024,

orienta on: 'horizontal', wipe: false }); [Link]().reset([splitPanel]);

// ----------------------------- // LEGEND PANEL // -----------------------------

var legend = [Link]({ style: { posi on: 'bo om-le ', padding: '8px 15px' } });

// Title [Link]([Link]({ value: 'LULC Classes', style: {fontWeight: 'bold',

fontSize: '14px', margin: '0 0 4px 0'} }));

// Class names and colors

var names = ['Water','Built-up','Vegeta on','Barren'];

for (var i = 0; i < [Link]; i++) { var colorBox = [Link]({ style: {

backgroundColor: '#' + pale e[i], padding: '8px', margin: '0 0 4px 0' } });

var desc = [Link]({ value: names[i], style: {margin: '0 0 4px 6px'} });

var row = [Link]({widgets: [colorBox, desc], layout:

[Link]('horizontal')}); [Link](row); }

// Add legend [Link](legend);

You might also like