I would like to share part of the NOAA/NGDC VIIRS Nighttime imagery (found at https://ngdc.noaa.gov/eog/viirs/download_monthly.html) with other people within my organization that do not use a spatial analysis software package. In my case this is QGIS. What I would like to do is upload the map I have created to some cloud service (obvious candidate here would be QGIS cloud), or share it with other people while the data is embedded in some sort of html file. Let's say I would like to share the Nighttime imagery of one country only, which we'll take as Ivory Coast for simplicity's sake. Here are the steps I have undertaken so far:

  1. Downloaded the latest nighttime light image for November 2016. To be able to crop the image to the right size, I have also downloaded the natural earth dataset and used the ne_10m_admin_0_countries vector layer.

  2. Once both data sets have been loaded into QGIS, I have cropped the nighttime imagery with the Raster>Extraction>Clipper tool. Hereby I use the Ivory Coast shape as the mask layer. To reduce the size of the 'clipped' nighttime imagery I also use suggestions found here: Clipping raster-image increases file size. (I fear that my troubles start here, since the 'clipped' image still contains the entire extent of the original nighttime image, even though I only want to have the Ivory Coast part. This manifests itself as everything being black outside of the cropped area up to the extent of the original image. I have looked for possibilities of 'cutting'/ 'cropping' (as you would do in any image manipulation software) all of the other data off, but couldn't find anything)

  3. Export the obtained results with some kind of tool. So far I have tried:

    • QGIS2Web: When I try this, it takes a long time before I get to the dialogue window where I can select relevant options. But as soon as I select the 'leaflet' option (the other option just shows a white screen), QGIS locks up and I am forced to restart the program. Retrying this does not do anything.
    • QGIS Cloud: When I try to upload the cropped raster layer, the uploading is extremely slow since it never comes close to the number of tiles it needs to upload (or maybe I am mis-assuming the size of the data that needs to be uploaded). In any case QGIS hangs often with this option and crashes after a while.

The other option to share these maps would be to just print them out, but the map maker also crashes if I want to export to an image/pdf file.

Could this be an issue with my PC (i5, 16GB RAM, Windows7), or am I trying to push too much data through QGIS and it's extensions?

  • Should they just be able to look at the image (at various zoom levels) or do you need more features than just that? – bugmenot123 Jan 25 '17 at 19:29
  • apart from zooming in to a certain level it would be good if I can add certain layers (land use, company assets, etc) and turn these on and off – Tim.Lucas Jan 25 '17 at 20:07
  • Can you tell us some of the file sizes? – Tom Chadwin Jan 26 '17 at 9:44
  • The Night time imagery is around 17 Mb currently, the asset points around 7Mb but I would like to add much larger layers if possible. – Tim.Lucas Jan 26 '17 at 9:47
  • Definitely not too much data for QGIS, but it's certainly possible that qgis2web could struggle. If the data is hosted somewhere, either as a WMS or on a tileserver, those would be better options, though your viewers would require an internet connection to be able to see it. – Tom Chadwin Jan 26 '17 at 11:09

For everyone also trying this out, I came up with a work around to export the maps using Python and Leaflet, using the package folium.

Importing vector layers with folium is no problem whatsoever, but the importing of geotiffs is (the fileformat is simply not accepted), so my solution here was to export the rendered images using QGIS to a new geotiff, and then convert that geotiff using GIMP to a PNG image. And yes, this will cause a lot of information to be lost in the geotiff, but for the application that I needed this for, this was not a big issue.

If anyone wants a sample script let me know.

PS. If anyone knows how to do it in QGIS, even better, since this requires quite a few extra steps. Suggestions are thus still very welcome!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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