Tuesday, 6 October 2015

qgis - Extracting Metadata of a GeoTiff image


I am working on Landsat 8 satellite image and want to perform land cover classification for a particular region Preferred software tool is R I have formed a RGB image from the satellite data and now want to extract the metadata of that image to work further on it


How can the metadata be extracted? Can it be done in R or should I use QGIS?



Answer




In QGIS, Right-click the layer you are visualizing > Click on Properties > Click on the blue i symbol (which stands for Metadata)


In R:


library(sp)
library(raster)
library(SDMTools)

#Create a raster layer and view the same
layer <- raster("path to folder where image is stored")
writeRaster(layer,"path to where want to write it to", format="ascii")


###Convert the ascii to dataframe
layer1 <- asc2dataframe("path where the ascii is stored")

Above should give you values for each row.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...