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'))
var ROI = ee.Geometry.Polygon(

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({

var lat = ee.List(coords.get('latitude'))
var lon = ee.List(coords.get('longitude'))

var point_list = lon.zip(lat)

var coords = cropLandcover.pixelLonLat()

1 Answer 1


A common technique in Earth Engine to export things like lists, values etc which are too large is to first create a feature collection from them and then export them. The feature collection need not have any geometry, so you can create features with empty geometry with the values of interest as properties.

In your case, the following snippet does the trick

var fc = ee.FeatureCollection(point_list.map(function(point) {
  return ee.Feature(null, {'value': point})

Then you can export fc to get the output as CSV


Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.