Export image as kmz

Has anyone had any issues with this. I have this product:
S1A_IW_GRDH_1SDV_20220208T020718_20220208T020743_041815_04FA2E_E19A_Cal_Spk_TC

File - export - view image as kmz

computer says no.

Any clues?

Hello,
you can have a look at Log file. This might reveal more details.
You can find the log file by selecting from the menu Help / Show Log Directory .
The error should be in the messages.log file.

java.lang.NegativeArraySizeException
at java.awt.image.DataBufferByte.(DataBufferByte.java:76)
at java.awt.image.Raster.createInterleavedRaster(Raster.java:266)
at java.awt.image.BufferedImage.(BufferedImage.java:391)
at org.esa.snap.rcp.actions.file.export.ExportImageAction.createImage(ExportImageAction.java:275)
[catch] at org.esa.snap.rcp.actions.file.export.ExportKmzFileAction$SaveKMLSwingWorker.doInBackground(ExportKmzFileAction.java:337)
at com.bc.ceres.swing.progress.ProgressMonitorSwingWorker.doInBackground(ProgressMonitorSwingWorker.java:56)
at javax.swing.SwingWorker$1.call(SwingWorker.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at javax.swing.SwingWorker.run(SwingWorker.java:334)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
WARNING [org.openide.filesystems.Ordering]: Found same position 35 for both Context/Product/Product/GroupByNodeTypeAction-separatorAfter.instance and Context/Product/Product/OpenRGBImageViewAction-separatorBefore.instance
java.lang.NegativeArraySizeException
at java.awt.image.DataBufferByte.(DataBufferByte.java:76)
at java.awt.image.Raster.createInterleavedRaster(Raster.java:266)
at java.awt.image.BufferedImage.(BufferedImage.java:391)
at org.esa.snap.rcp.actions.file.export.ExportImageAction.createImage(ExportImageAction.java:275)
at org.esa.snap.rcp.actions.file.export.ExportKmzFileAction$SaveKMLSwingWorker.doInBackground(ExportKmzFileAction.java:337)
at com.bc.ceres.swing.progress.ProgressMonitorSwingWorker.doInBackground(ProgressMonitorSwingWorker.java:56)
at javax.swing.SwingWorker$1.call(SwingWorker.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at javax.swing.SwingWorker.run(SwingWorker.java:334)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
SEVERE [org.esa.snap.rcp.SnapApp]: The image could not be exported
java.lang.NegativeArraySizeException
at java.awt.image.DataBufferByte.(DataBufferByte.java:76)
at java.awt.image.Raster.createInterleavedRaster(Raster.java:266)
at java.awt.image.BufferedImage.(BufferedImage.java:391)
at org.esa.snap.rcp.actions.file.export.ExportImageAction.createImage(ExportImageAction.java:275)
[catch] at org.esa.snap.rcp.actions.file.export.ExportKmzFileAction$SaveKMLSwingWorker.doInBackground(ExportKmzFileAction.java:337)
at com.bc.ceres.swing.progress.ProgressMonitorSwingWorker.doInBackground(ProgressMonitorSwingWorker.java:56)
at javax.swing.SwingWorker$1.call(SwingWorker.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at javax.swing.SwingWorker.run(SwingWorker.java:334)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

It seems this might be the problem.

Thanks for this report.
IT seems to be related to a known issue:
[SNAP-1228] Exporting large image views not possible - JIRA (atlassian.net)

The image is just too big. If you use a smaller region it should work.

Hello!!!

I want export a complete image, a combination in change detection full resolution and it dont work!!!.. any clues? :woozy_face:

We need more information: please upload the messages.log file (from Help/Show log directory) corresponding to the error. The messages.log file should provide more complete details.

  • if you used export from the image view, try export from the File menu, or vice versa

  • try converting the virtual bands (the ones with a “V” icon) to actual bands

It might be due to the reason I said in the message above.
The image might be too big.
What’s the size in pixels?

1 Like

@gabrielaquintana77 Maybe it is not necessary to export the image. In case you want to use it in a GIS, you can skip the Export step and directly open the img file: Export of products from SNAP

1 Like

Thanks Andreas!!! I will trying…

Can this method of saving an image be implemented using Snap gpt? I need to save sentinel-1 images as png, but struggling to work this out with the use of a graph.

You can try the WriteRGB as last operator of your chain or in addition to a normal WriteOp. It is very simple and allows only the selection of 3 bands for the 3 RGB channels.
If you only want to have one band you might specify this for all 3 channels.

With pconvert you have more options.
See Export bands as images enmasse - #3 by marpet
In this case you have to write the data first and then convert it to an image, but it gives you more options. Afterwards you can delete the data file.

Thank you for getting back to me so quickly. I have Snap version 9.0 installed, I can’t see pconvert in the list when I run gpt -h, do I need an older version of Snap?

It is not part of gpt, it is separate tool.

Run pconvert -h from the command line.
When you open the SNAP help you can also see an introduction page.

1 Like

Ah that makes sense! Thank you, I will give it a go.

Hello all!
I did a change detection in the Bakhmut City I made the exporting to the format .kmz making a subset of the image !!!.. This worked well…