I want to extract lat/lon values in GEE and I found the following code on stack exchange which does the job. However, when I try to print the lat/ lon values in GEE, it starts to crash. I am going to take a guess here and say it most likely because there is a large number of values ( I could be wrong). Therefore I am trying to export the lists (var point_list in this instance) into a csv, but not quite sure to go on doing that.
Any ideas?
var dataset = ee.ImageCollection('USDA/NASS/CDL')
.filter(ee.Filter.date('2017-01-01', '2018-12-31'))
.first()
var ROI = ee.Geometry.Polygon(
[[[-98.32711839622601,43.77454409032633],
[-98.32711839622601,43.296678036299085],
[-97.40426683372601,43.3126679077047],
[-97.44821214622601,43.80626716084386],
[-98.32711839622601,43.77454409032633]]]
var image_clipped = dataset.clip(ROI)
var proj = image_clipped.select('cropland').projection()
var latlon = ee.Image.pixelLonLat().reproject(proj)
var coords = latlon.select(['longitude','latitude']).reduceRegion({
reducer:ee.Reducer.toList(),
geometry:ROI
})
var lat = ee.List(coords.get('latitude'))
var lon = ee.List(coords.get('longitude'))
var point_list = lon.zip(lat)
var coords = cropLandcover.pixelLonLat()