4

I want to calculate the Night Light Development Index (NLDI). For this reason I am using a night-time lights satellite image and a population raster layer, which they have the same dimensions, extent and projection system. In order to calculate the index, firstly, I need to create a table like the one in the image attached. I have found that I can use the function Cross-Classification and Tabulation in QGIS. The problem is that when I am using the function the resulting table is full of 0 values. Any idea what might be the issue? Here are my data:

new("RasterStack", filename = "", layers = list(new("RasterLayer", 
    file = new(".RasterFile", name = "C:\\Users\\Geography\\Desktop\\esda\\mumbai\\2018\\pop.tif", 
        datanotation = "FLT4S", byteorder = "little", nodatavalue = -Inf, 
        NAchanged = FALSE, nbands = 1L, bandorder = "BIL", offset = 0L, 
        toptobottom = TRUE, blockrows = 9L, blockcols = 215L, 
        driver = "gdal", open = FALSE), data = new(".SingleLayerData", 
        values = logical(0), offset = 0, gain = 1, inmemory = FALSE, 
        fromdisk = TRUE, isfactor = FALSE, attributes = list(), 
        haveminmax = TRUE, min = 10.014267921448, max = 601.32739257812, 
        band = 1L, unit = "", names = "pop"), legend = new(".RasterLegend", 
        type = character(0), values = logical(0), color = logical(0), 
        names = logical(0), colortable = logical(0)), title = character(0), 
    extent = new("Extent", xmin = 582800, xmax = 604300, ymin = 1005700, 
        ymax = 1047400), rotated = FALSE, rotation = new(".Rotation", 
        geotrans = numeric(0), transfun = function () 
        NULL), ncols = 215L, nrows = 417L, crs = new("CRS", projargs = "+proj=lcc +lat_0=18.88015774 +lon_0=76.75 +lat_1=16.625 +lat_2=21.125 +x_0=1000000 +y_0=1000000 +datum=WGS84 +units=m +no_defs"), 
    history = list(), z = list()), new("RasterLayer", file = new(".RasterFile", 
    name = "C:\\Users\\Geography\\Desktop\\esda\\mumbai\\2018\\nov\\ntl_atprk.tif", 
    datanotation = "FLT8S", byteorder = "little", nodatavalue = -Inf, 
    NAchanged = FALSE, nbands = 1L, bandorder = "BIL", offset = 0L, 
    toptobottom = TRUE, blockrows = 4L, blockcols = 215L, driver = "gdal", 
    open = FALSE), data = new(".SingleLayerData", values = logical(0), 
    offset = 0, gain = 1, inmemory = FALSE, fromdisk = TRUE, 
    isfactor = FALSE, attributes = list(), haveminmax = TRUE, 
    min = 0.32394027709961, max = 348.45766448975, band = 1L, 
    unit = "", names = "ntl_atprk"), legend = new(".RasterLegend", 
    type = character(0), values = logical(0), color = logical(0), 
    names = logical(0), colortable = logical(0)), title = character(0), 
    extent = new("Extent", xmin = 582800, xmax = 604300, ymin = 1005700, 
        ymax = 1047400), rotated = FALSE, rotation = new(".Rotation", 
        geotrans = numeric(0), transfun = function () 
        NULL), ncols = 215L, nrows = 417L, crs = new("CRS", projargs = "+proj=lcc +lat_0=18.88015774 +lon_0=76.75 +lat_1=16.625 +lat_2=21.125 +x_0=1000000 +y_0=1000000 +datum=WGS84 +units=m +no_defs"), 
    history = list(), z = list())), title = character(0), extent = new("Extent", 
    xmin = 582800, xmax = 604300, ymin = 1005700, ymax = 1047400), 
    rotated = FALSE, rotation = new(".Rotation", geotrans = numeric(0), 
        transfun = function () 
        NULL), ncols = 215L, nrows = 417L, crs = new("CRS", projargs = "+proj=lcc +lat_0=18.88015774 +lon_0=76.75 +lat_1=16.625 +lat_2=21.125 +x_0=1000000 +y_0=1000000 +datum=WGS84 +units=m +no_defs"), 
    history = list(), z = list())

image

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.