Showing posts with label Web Document. Show all posts
Showing posts with label Web Document. Show all posts

Thursday, April 11, 2024

The Rising Tide: Visualizing the Impact of a 5-Meter Sea Level Increase on Mumbai with GIS Technology

Introduction:

Start with a brief overview of climate change and its potential impacts, specifically focusing on sea level rise. Introduce Mumbai as a case study for this analysis due to its coastal location and significance. Mention the use of GIS technology (ArcGIS Pro and QGIS) and various datasets, including Google's Open Buildings, SRTM DEM images, coastal and maritime boundaries, and vector layers for roads, railways, water bodies, and green spaces.

5-Meter Sea Level Increase on Mumbai


Background:

  • Climate Change and Sea Level Rise: Explain the science behind sea level rise as a consequence of global warming.
  • Mumbai's Vulnerability: Discuss why Mumbai is particularly at risk, including its geographic, economic, and demographic aspects.
  • GIS in Climate Change Analysis: Briefly introduce GIS technology and its importance in analyzing and visualizing climate change impacts.

Data and Methodology:

  • Data Sources: Describe each data source used in the study, including their origins, contents, and relevance.
  • GIS Tools and Techniques: Elaborate on how ArcGIS Pro and QGIS were utilized to overlay and analyze the data. Discuss the process of simulating a 5-meter sea level rise.
  • Challenges and Limitations: Address any challenges encountered during the analysis, including data accuracy, projection issues, or software limitations.

Analysis and Findings:

  • Impacted Areas: Detail which parts of Mumbai are most at risk, supported by maps and visuals created through GIS. Discuss the implications for residential areas, infrastructure, and key landmarks.
  • Infrastructure at Risk: Focus on critical infrastructure such as roads, railways, and utilities. Analyze the potential disruptions and the cascading effects on the city's functionality.
  • Environmental and Social Impacts: Assess the impact on green spaces, water bodies, and the broader ecological system. Discuss how communities, especially marginalized ones, are affected.
  • Comparative Analysis: If possible, compare Mumbai's situation with other coastal cities globally to provide a broader context.

Implications and Solutions:

  • Mitigation Strategies: Discuss potential mitigation strategies to combat sea level rise, including both global (e.g., reducing carbon emissions) and local (e.g., building sea walls) approaches.
  • Adaptation Measures: Suggest how Mumbai can adapt to the inevitable changes, such as through urban planning and community resilience programs.
  • The Role of Technology: Highlight how GIS and other technologies can aid in both understanding the problem and implementing solutions.

Conclusion:

Summarize the key findings and the importance of taking immediate action to mitigate and adapt to sea level rise. Emphasize the role of GIS technology in planning for climate change impacts. End with a call to action for policymakers, researchers, and the general public.

References:

Include all the data sources, research papers, and additional reading materials used for your analysis.

Introduction Draft:

The specter of climate change looms large over the globe, manifesting in extreme weather events, temperature anomalies, and a phenomenon deeply concerning for coastal cities worldwide: sea level rise. Mumbai, India's bustling financial capital, stands on the frontline of this environmental challenge. Given its geographical location, economic significance, and dense population, understanding Mumbai's vulnerability to rising sea levels is not just a local concern but a global imperative.

This article employs Geographic Information Systems (GIS) technology, specifically ArcGIS Pro and QGIS, to visualize and analyze the impact of a hypothetical 5-meter rise in sea levels on Mumbai. Through an intricate layering of data from Google's Open Buildings, SRTM DEM images, and various vector layers depicting the city's infrastructure and natural geography, we embark on a comprehensive examination of what the future might hold for this vibrant city under siege by the changing climate.


Sunday, August 27, 2023

Generating 1 km x 1 km Square Polygons Automatically in Google Earth Engine

 Introduction:

Google Earth Engine (GEE) is a powerful platform that allows users to analyze and visualize geospatial data at an unprecedented scale. In this tutorial, we'll explore how to create 1 km x 1 km square polygons automatically using Google Earth Engine. This can be incredibly useful for tasks such as defining study areas, generating sample regions, or creating consistent spatial units for analysis. Let's dive in!


Step 1: Setting Up Google Earth Engine Environment

If you haven't already, sign up for a Google Earth Engine account and access the GEE Code Editor. This cloud-based platform provides an interactive environment to write and run code for geospatial analysis.


Step 2: Defining the Area of Interest (AOI)

Start by defining the geographical coordinates or a region of interest where you want to create the 1 km x 1 km square polygons. For instance, you might be interested in a specific location for a study.

Generating 1 km X 1 km square polygon
Figure 1: Autogenerate 1sq km polygon


Step 3: Writing the Code

In the GEE Code Editor, use JavaScript to write the code for generating the square polygons.

CODE:--------------------------------------------------------

var targetArea = ee.Number(1e6)


function toSquare(buffer) {

  return point.buffer(buffer, 1).bounds()

}

function getBuffer(area) {

  return ee.Number(area).sqrt().divide(2)

}

var buffer = getBuffer(targetArea)

var minBuffer = buffer.multiply(0.99)

var maxBuffer = buffer.multiply(1.01)

var square, area

for (var i = 0; i < 100; i++) {

  var buffer = minBuffer.add(maxBuffer).divide(2)

  square = toSquare(buffer)

  area = square.area(1)

  minBuffer = ee.Number(ee.Algorithms.If(area.lt(targetArea), buffer, minBuffer))

  maxBuffer = ee.Number(ee.Algorithms.If(area.gt(targetArea), buffer, maxBuffer))

}

print(square)

print("Area of Square", area)

Map.addLayer(square)

Map.centerObject(square)


//Export to Drive


var generatedGeometry = square;

var geojsonFeature = ee.Feature(generatedGeometry);

var geojson = geojsonFeature.toGeoJSONString();


Export.string.toDrive({

  data: geojson,

  description: '1sq_km',

  folder: 'GEE',

  fileFormat: 'GeoJSON'

});

------------------------------------------------------

Step 4: Customizing the Output

You can customize the appearance of the generated square polygon by adjusting the visualization parameters. For instance, you can change the color, opacity, and border properties of the polygon to suit your needs.


Step 5: Exporting and Sharing

Once you're satisfied with the generated square polygon, you can explore further analyses within Google Earth Engine or export the polygon for use in other GIS software. Here I export the polygon in GeoJSON format in my google drive.


Conclusion:

Automatically generating 1 km x 1 km square polygons in Google Earth Engine is a straightforward process that can assist in various geospatial tasks. This tutorial demonstrated the basic steps to create a square polygon around a given center point. As you become more familiar with Google Earth Engine's capabilities, you can build on this foundation to create more complex polygons, integrate other datasets, and perform advanced spatial analyses.


Remember that Google Earth Engine's extensive documentation and user community are excellent resources for expanding your knowledge and exploring the platform's full potential. 

Happy mapping!

Monday, July 11, 2022

How to Open Sentinel 2 Satellite Images in Google Earth Engine (With TCC and FCC)

 Sentinel 2 Satellite Images open in Google Earth Engine and layer add in map with TCC and FCC.

Here we will be doing Sentinel 2 satellite image open by Google Earth Engine (GEE), Here we will open the sentinel 2 image, we will see it as a True color composition (TCC) and in False color composition (FCC) images using Google Earth engine (GEE).

At first import the layer of AOI/ROI or point and sentinel satellite image in GEE.

How to Open Sentinel 2 Satellite Images in Google Earth Engine

Than write the code in editor section.

How to Open Sentinel 2 Satellite Images in Google Earth Engine

Define visualization parameters in a JavaScript dictionary for true color rendering. Bands 4,3, and 2 are needed for RGB (true color composite).

How to Open Sentinel 2 Satellite Images in Google Earth Engine

Define visualization parameters in a JavaScript dictionary for true color rendering. Bands 8,4,3 are needed for RGB (false color composite).

How to Open Sentinel 2 Satellite Images in Google Earth Engine


the programming code is given below to make the process easier.

CODE:

-------------------------------------------------------------------------------------------------------------

// Let’s define the image collection we are working with by writing this command. // We are creating a new variable 'image' that will come from the L8 collection we have imported. (Please Change the name "S2") var image = ee.Image(S2 // We will then include a filter to get only images in the date range we are interested in .filterDate("2019-07-01", "2022-03-30") // Next we include a geographic filter to narrow the search to images at the location of our ROI point. (Please Change the name "ROI") .filterBounds(ROI) // Next we will also sort the collection by a metadata property, in our case cloud cover is a very useful one .sort("CLOUD_COVERAGE_ASSESSMENT") // Now lets select the first image out of this collection - i.e. the most cloud free image in the date range .first()); // And let's print the image to the console. print("A Sentinel scene:", image); // Define visualization parameters in a JavaScript dictionary for true colour rendering. // Bands 4,3, and 2 are needed for RGB (true colour composite). var trueColour = { bands: ["B4", "B3", "B2"], min: 0, max: 3000 }; // Define visualization parameters in a JavaScript dictionary for true colour rendering. // Bands 8,4,3 are needed for RGB (false colour composite). var falseColour = { bands: ["B8", "B4", "B3"], min: 0, max: 3000 }; // Centre the scene to the ROI Map.centerObject(ROI, 12); // Add the image to the map, using the visualization parameters. Map.addLayer(image, trueColour, "true-colour image"); // Add the image to the map, using the visualization parameters. Map.addLayer(image, falseColour, "false-colour image");

-------------------------------------------------------------------------------------------------------------

We hope you find this code useful. Stay tuned with us to find out and learn new things like this. If there is any problem you can let us know by commenting below or contacting us.


Monday, June 13, 2022

Random forest Image Classification Using Google Earth Engine (GEE code for RF classification)

Random forest (RF) Image Classification Using Google Earth Engine (GEE):

Here we will be doing satellite image processing by Google Earth Engine (GEE), Here we will classify random forest (RF) images using Google Earth engine (GEE).

We've put the whole process of this RF classification on YouTube, and the programming code is given below to make the process easier.

YouTube Link: https://youtu.be/moFOIpm3JcI

CODE:

-------------------------------------------------------------------------------------------------------------

Map.centerObject(studyarea,11);


var SFCCvis = {bands: ['B8', 'B4', 'B3'], max: 3000};


////////Sentinel-2 Data 2020////////

var S2020 = ee.ImageCollection('COPERNICUS/S2')

                  .filterDate('2021-03-01', '2021-03-31')

                  .filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE', 20))

                  .filterBounds(studyarea);

print(S2020, 'S2 Data 2020');


var listS2020dataset=S2020.toList(S2020.size());

print(listS2020dataset, 'Data list_2020');


var img1 = ee.Image(listS2020dataset.get(5)).clip(studyarea);

Map.addLayer(img1, SFCCvis, 'SFCC Image1');

//Cloudfree scenes: 0,2,4,5



var imgcollection=ee.ImageCollection([ee.Image(listS2020dataset.get(0)),

ee.Image(listS2020dataset.get(2)),ee.Image(listS2020dataset.get(4)),

ee.Image(listS2020dataset.get(5))])

.select(['B2','B3','B4','B5','B6','B7','B8','B8A','B11','B12']);

print(imgcollection, 'imgcollection');



////Image stacking

var stackCollection = function(imgcollection) {

  var first = ee.Image(imgcollection.first()).select([]);

  var appendBands = function(image, previous) {

    return ee.Image(previous).addBands(image);

  };

  return ee.Image(imgcollection.iterate(appendBands, first));

};


var image_stack = stackCollection(imgcollection);

print(image_stack, 'Image Stack');




////// Image Classification

// Class Merging

var polygons=Forest.merge(Cropland).merge(Fallow).merge(Waterbody).merge(Sand);

print(polygons, 'Training data');


var sample = polygons.randomColumn();

var trainingsample = sample.filter('random <= 0.75');

var validationsample = sample.filter('random > 0.75');

print(trainingsample, 'Training sample');

print(validationsample, 'Validation sample');



var training = image_stack.sampleRegions({

    collection: trainingsample,

    properties: ['Class'],

    scale: 20

});

print(training, 'Training data Band values');


var validation = image_stack.sampleRegions({

    collection: validationsample,

    properties: ['Class'],

    scale: 20

});



//RF Classifier Model Building

//ee.Classifier.smileRandomForest(numberOfTrees, 

//variablesPerSplit, minLeafPopulation, bagFraction, maxNodes, seed)

var RFclassifier = ee.Classifier.smileRandomForest(200).train(training, 'Class');


var Classified = image_stack.classify(RFclassifier).clip(studyarea);

//print(Classified, 'Classified');


var Palette = [

  'green', //Forest

  'yellow', //Cropland 

  '#a89e32', //Fallow

  'blue', //Waterbody

  'grey', //Sand

];

Map.addLayer(Classified, {palette: Palette, min: 1, max: 5}, 'Classified map');


//// Accuracy Assessment

// Get a confusion matrix and overall accuracy for the training sample.

var trainAccuracy = RFclassifier.confusionMatrix();

print('Training error matrix', trainAccuracy);

print('Training overall accuracy', trainAccuracy.accuracy());


// Get a confusion matrix and overall accuracy for the validation sample.

validation = validation.classify(RFclassifier);

var validationAccuracy = validation.errorMatrix('Class', 'classification');

print('Validation error matrix', validationAccuracy);

print('Validation accuracy', validationAccuracy.accuracy());



///// Variable Importance

var explain = RFclassifier.explain();

print(explain, 'Explain');


//Variable Importance of RF Classifier

var variable_importance = ee.Feature(null, ee.Dictionary(explain).get('importance'));


// Chart of Variable Importance of RF Classifier

var chartTitle = 'Random Forest: Bands Variable Importance';

var chart =

    ui.Chart.feature.byProperty(variable_importance)

      .setChartType('BarChart')

      .setOptions({

        title: chartTitle,

        legend: {position: 'none'},

        hAxis: {title: 'Importance'},

        vAxis: {title: 'Bands'}

      });

// Chart: Location and Plot

chart.style().set({

  position: 'bottom-left',

  width: '400px',

  height: '400px'

});

Map.add(chart);



////// Export

Export.image.toDrive({

  image: Classified,

  description: 'RF_Classified_map',

  region: studyarea,

  scale: 20,

  fileFormat: 'GeoTIFF',

  maxPixels: 1e9,

});


//https://code.earthengine.google.com/73aa2cc676bdca3f0c866472b3097d60

-------------------------------------------------------------------------------------------------------------

We hope you find this code useful. Stay tuned with us to find out and learn new things like this. If there is any problem you can let us know by commenting below or contacting us.


Wednesday, April 20, 2022

Google Earth Engine (GEE) Normalized Difference Vegetation Index (NDVI) For MODIS

Normalized Difference Vegetation Index (NDVI) in Google Earth Engine (GEE) for MODIS Data:

Here we will be doing satellite image processing by Google Earth Engine (GEE), the first of we will Normalized Difference Vegetation Index (NDVI) for MODIS Data using Google Earth Engine (GEE). 

We've put the whole process of this NDVI on YouTube, and the programming code is given below to make the process easier.

YouTube Link: https://youtu.be/hVUMpvTlYNA

Code:

-------------------------------------------------------------------------------------------------------

var dataset = ee.ImageCollection('LANDSAT/LC08/C01/T1_8DAY_NDVI') .filterDate('2017-01-01', '2017-12-31'); var colorized = dataset.select('NDVI'); print(colorized) var ndvi=colorized.reduce(ee.Reducer.mean()); print(ndvi) var ndvi_crop=ndvi.clip(geometry); var colorizedVis = { min: 0.0, max: 1.0, palette: [ 'FFFFFF', 'CE7E45', 'DF923D', 'F1B555', 'FCD163', '99B718', '74A901', '66A000', '529400', '3E8601', '207401', '056201', '004C00', '023B01', '012E01', '011D01', '011301' ], }; Map.setCenter(87.45, 21.55, 12); Map.addLayer(ndvi_crop, colorizedVis, 'Colorized'); Export.image.toDrive({ image: ndvi_crop, description: 'avg_NDVI_2017', scale: 30, maxPixels: 1e13, });

-------------------------------------------------------------------------------------------------------------

We hope you find this code useful. Stay tuned with us to find out and learn new things like this. If there is any problem you can let us know by commenting below or contacting us.


Monday, April 18, 2022

R for Basic Image Processing (Landsat Image) Part 1

 Basic Image Processing using R-Programing (Landsat Image):

Here we will be doing satellite image processing by R-programming, the first of the basic satellite image processing we will layer stack the satellite image using R-programming. 

We've put the whole process of this layer stack on YouTube, and the programming code is given below to make the process easier.

YouTube Link: https://youtu.be/_nCUUBKKHsg

---------------------------------------------------------------------------------------------

Code:

#To install packages

install.packages("raster")

install.packages("rgdal")


#Add Library

library(raster)     #raster

library(rgdal)      #vector


#Read and plot data (LANDSAT 5 Data)

a<-"D:/Landsat_image/LT05_L1TP_139046_20050303/LT05_L1TP_139046_20050303_20161128_

01_T1_B1.TIF"

a

??raster

a1<-raster(a)

a1


a4<-raster("D:/Landsat_image/LT05_L1TP_139046_20050303/LT05_L1TP_139046_20050303_2

0161128_01_T1_B4.TIF")

a4

?plot

plot(a4)

?dim

dim(a4) #dimension of data, row, column and band



#Set Working directory

setwd("D:/Landsat_image/LT05_L1TP_139046_20050303")

getwd()




#Read bulk data

bands<-list.files(pattern=".TIF")

bands

bands[[2]]      # select layer2 from list


band2<-raster(bands[[2]])



#Layer stack; band selection; plot

sfcc<-stack(bands[1],bands[2],bands[3],bands[4],bands[5],bands[7])

sfcc

sfcc[[4]]      # select layer 4 from stack

plot(sfcc[[3]])

plotRGB(sfcc, 4,3,2)

plotRGB(sfcc, 4,3,2, stretch='lin')

?plotRGB

?writeRaster

writeRaster(sfcc, "Landsat_5.tif", format="GTiff", datatype='INT1U', overwrite=TRUE)



#READ LANDSAT 8 Data

setwd("D:/Landsat_image/LC08_L1TP_139046_20150227")

getwd()


#Read bulk data

bands<-list.files(pattern=".TIF")

bands

bands[[4]]      # select Blue band from list




#Layer stack; band selection; plot

sfcc<-stack(bands[4],bands[5],bands[6],bands[7])

sfcc

sfcc[[4]]      # select layer 4 from stack

plot(sfcc[[4]])

plotRGB(sfcc, 4,3,2)

plotRGB(sfcc, 4,3,2, scale=65535)

plotRGB(sfcc, 4,3,2, scale=65535, stretch='lin')

writeRaster(sfcc, "Landsat_8.tif", 

            format="GTiff", datatype='INT2U', overwrite=TRUE)



L8<-brick("Landsat_8.tif")

L8

--------------------------------------------------------------------------------------------

We hope you find this code useful. Stay tuned with us to find out and learn new things like this. If there is any problem you can let us know by commenting below or contacting us.