0

I have tried a handful of things ( different export settings ) but every time I download the tiff and try to view it in various applications, I see it is either corrupt, empty, or black. The layers added to the map are all rendering well so I am thinking I have to something with the bands to make the export viewable? Here is my code:

var bexar = ee.Geometry.Polygon({ coords: ...some long geojson polygon... })
var recent = ee.ImageCollection('COPERNICUS/S5P/OFFL/L3_NO2')
.select('tropospheric_NO2_column_number_density')
.filterDate('2020-03-15', '2020-04-24')
.map(function(image){return image.clip(bexar)}) ;

var febmar = ee.ImageCollection('COPERNICUS/S5P/OFFL/L3_NO2')
.select('tropospheric_NO2_column_number_density')
.filterDate('2020-02-04', '2020-03-14')
.map(function(image){return image.clip(bexar)});

var janmar = ee.ImageCollection('COPERNICUS/S5P/OFFL/L3_NO2')
.select('tropospheric_NO2_column_number_density')
.filterDate('2019-12-26', '2020-02-04')
.map(function(image){return image.clip(bexar)});


var band_viz = {
min: 0,
max: 0.00005,
palette: ['black', 'blue', 'purple', 'cyan', 'green', 'yellow', 'red']
};

Map.addLayer(recent.mean(), band_viz, 'recent N02');
Map.addLayer(febmar.mean(), band_viz, 'febmar N02');
Map.addLayer(janmar.mean(), band_viz, 'janmar N02');


Map.setCenter(-98.949287,29.771605, 7);



var recentBands = recent.toBands()
var febmarbands = febmar.toBands()
var janmarbands = janmar.toBands()



Export.image.toDrive(recentBands, 'lockdown_emissions')
Export.image.toDrive(febmarbands, 'febmar2019')
Export.image.toDrive(janmarbands, 'janmar2019')

1 Answer 1

1

You're not exporting the same thing you're visualizing on the map. The images you export contain some 500 bands. Is what you intended to do? I'm not surprised that some applications have problems with opening it. Which applications did you try, and how did you try to visualize this? For me, it opens fine in QGIS, and and I see some data when inspecting some pixels, but it's pretty sparse. The first three bands seem to be completely masked, so if you just render them (default in QGIS), you'll get nothing.

Here's an updated script, clipping the images as late as possible in the processing, and setting the scale and region when exporting the images. None of these should really have any impact of your actual problem, just often a good idea to do.

var bexar = ee.Geometry.Point([-98.949287, 29.771605]).buffer(10000).bounds()
var collection = ee.ImageCollection('COPERNICUS/S5P/OFFL/L3_NO2')
  .select('tropospheric_NO2_column_number_density')

var recent = collection
  .filterDate('2020-03-15', '2020-04-24')

var febmar = collection
  .filterDate('2020-02-04', '2020-03-14')

var janmar = collection
  .filterDate('2019-12-26', '2020-02-04')


var band_viz = {
  min: 0,
  max: 0.00005,
  palette: ['black', 'blue', 'purple', 'cyan', 'green', 'yellow', 'red']
}

Map.addLayer(recent.mean().clip(bexar), band_viz, 'recent N02')
Map.addLayer(febmar.mean().clip(bexar), band_viz, 'febmar N02')
Map.addLayer(janmar.mean().clip(bexar), band_viz, 'janmar N02')

Map.centerObject(bexar, 10)

var recentBands = recent.toBands().clip(bexar)
var febmarbands = febmar.toBands().clip(bexar)
var janmarbands = janmar.toBands().clip(bexar)

Export.image.toDrive({
  image: recentBands,
  description: 'lockdown_emissions',
  scale: 1113,
  region: bexar
})
Export.image.toDrive({
  image: febmarbands,
  description: 'febmar2019',
  scale: 1113,
  region: bexar
})
Export.image.toDrive({
  image: janmarbands,
  description: 'janmar2019',
  scale: 1113,
  region: bexar
})

https://code.earthengine.google.com/297af444d951d3abadbbf91338fbab1e

1
  • This was helpful. I figured out yesterday I need to do the same things to the layer to get what I want but needed to run slightly different methods. After running .mean() and .visualize() with the band_viz arg. I was able to export okay
    – maxwell
    Commented Apr 29, 2020 at 14:11

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.