I want to extract the elevation values and generate contour lines from SRTM DEM at a 100 m intervals. However, I was able to create the contour lines using a code available here. But I am not able to interpret the exported result (shapefile) format. The attribute of the exported result is shown below.
I am not able to understand, what the field "count" mean. Also, I want to extract the elevation values corresponding to each contour line. Is it possible to extract the elevation values in Google Earth Engine using the generated contours?
I am stuck after this much progress.
var srtm = ee.Image('USGS/SRTMGL1_003');
var lines = ee.List.sequence(0, 10000, 100)
var contourlines = lines.map(function(line) {
var mycontour = srtm
.convolve(ee.Kernel.gaussian(5, 3))
.subtract(ee.Image.constant(line)).zeroCrossing()
.multiply(ee.Image.constant(line)).toFloat()
.clip(table)
return mycontour.mask(mycontour);
})
contourlines = ee.ImageCollection(contourlines).mosaic()
Map.addLayer(contourlines, {min: 0, max: 5000, palette:['00ff00', 'ff0000']}, 'contours')
Map.centerObject(table,5)
var contour = contourlines.toInt();
var vectors = contour.reduceToVectors({
geometry: table,
scale: 30,
maxPixels: 1e13
})
Export.table.toDrive({
collection: vectors,
description: "ContourLines",
folder:"DEM",
//geometry: NE,
fileFormat: "SHP",
})
'table' is the extent of my study area.