Installation, gpt not working -- Environment Variable missing?

I uninstalled NEST and installed SNAP. But gpt is not working from command line. Could it be that an environment variable or Path is missing? I have Windows 7 64 bit

[EDIT: I seem to have found out myself: I have to manually add to the Path System Variable the Path to STBX1, which in my case is C:\Program Files\snap\bin\ — but this means there is a bug in SNAP not adding this variable automatically during installation. NEST used to do so ]

Ok, will be fixed for final release!
https://senbox.atlassian.net/browse/SNAP-111

–Norman

I cannot start gpt.exe on my Windows7-64 bit machine due to the following error message:

My version is snap 2.0 beta 7. I also tried to install snap by putting the exe on the c drive and starting it with administrator rights. I also added the environment variable as described above. The error appears if I double-click within Windows Explorer but also when entering “gpt.exe” in cmd.exe.

If I move the file to C: the command line says “couldn’t load main class”.

Any ideas on this?

Not sure if I tried that before, but with “gpt -h” I can get the tool running with the windows command line (in the meanwhile I have beta 8 running)

The problem you have observed in beta-07 sounds like a broken SNAP configuration. Probably the problem has been solved by installing beta-08 and removing old stuff from the previous installation.

I have set up a simple model ( input --> S1-calibration --> output ) in the graph builder. This worked fine. When I saved the xml and used this in the command line, I received the following error-message, which seems to be related to memory problems. Any idea for a solution?

C:\Users\Name>gpt D:\Z_Dissertation\Code\Calibrate_VH_gpt_builder1.xml
Calibration: java.lang.NullPointerException
Calibration: java.lang.NullPointerException
org.esa.snap.core.gpf.OperatorException: I/O error reading image metadata!
        at org.esa.snap.core.gpf.graph.GraphProcessor$GPFImagingListener.errorOc
curred(GraphProcessor.java:373)
        at com.sun.media.jai.util.SunTileScheduler.sendExceptionToListener(SunTi
leScheduler.java:1646)
        at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler
.java:921)Calibration: Empty region!

        at javax.media.jai.OpImage.getTile(OpImage.java:1129)Calibration: Empty
region!

        at javax.media.jai.PlanarImage.getData(PlanarImage.java:2085)
        at com.bc.ceres.glevel.MultiLevelImage.getData(MultiLevelImage.java:64)
        at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(Operator
Context.java:420)
        at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(Operator
Context.java:406)
        at org.esa.snap.core.gpf.Operator.getSourceTile(Operator.java:440)
        at org.esa.s1tbx.calibration.gpf.Sentinel1Calibrator.computeTile(Sentine
l1Calibrator.java:550)
        at org.esa.s1tbx.calibration.gpf.CalibrationOp.computeTile(CalibrationOp
.java:182)
        at org.esa.snap.core.gpf.internal.OperatorImage.computeRect(OperatorImag
e.java:80)
        at javax.media.jai.SourcelessOpImage.computeTile(SourcelessOpImage.java:
137)
        at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler
.java:904)
        at javax.media.jai.OpImage.getTile(OpImage.java:1129)
        at javax.media.jai.PlanarImage.getData(PlanarImage.java:2085)
        at com.bc.ceres.glevel.MultiLevelImage.getData(MultiLevelImage.java:64)
        at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(Operator
Context.java:420)
        at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(Operator
Context.java:406)
        at org.esa.snap.core.gpf.internal.OperatorImage.computeRect(OperatorImag
e.java:73)
        at javax.media.jai.SourcelessOpImage.computeTile(SourcelessOpImage.java:
137)
        at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler
.java:904)
        at javax.media.jai.OpImage.getTile(OpImage.java:1129)
        at com.sun.media.jai.util.RequestJob.compute(SunTileScheduler.java:247)
        at com.sun.media.jai.util.WorkerThread.run(SunTileScheduler.java:468)
Caused by: org.esa.snap.core.gpf.OperatorException: I/O error reading image meta
data!
        at org.esa.snap.core.gpf.common.ReadOp.computeTile(ReadOp.java:111)
        at org.esa.snap.core.gpf.internal.OperatorImage.computeRect(OperatorImag
e.java:80)
        at javax.media.jai.SourcelessOpImage.computeTile(SourcelessOpImage.java:
137)
        at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler
.java:904)
        ... 22 more
Caused by: javax.imageio.IIOException: I/O error reading image metadata!
        at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.readMetadata
(TIFFImageReader.java:670)
        at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.seekToImage(
TIFFImageReader.java:618)
        at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.seekToImage(
TIFFImageReader.java:576)
        at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.prepareRead(
TIFFImageReader.java:1327)
        at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.readAsRender
edImage(TIFFImageReader.java:1374)
        at org.esa.s1tbx.io.imageio.ImageIOFile.getData(ImageIOFile.java:311)
        at org.esa.s1tbx.io.imageio.ImageIOFile.readImageIORasterBand(ImageIOFil
e.java:264)
        at org.esa.s1tbx.io.sentinel1.Sentinel1ProductReader.readBandRasterDataI
mpl(Sentinel1ProductReader.java:132)
        at org.esa.snap.core.dataio.AbstractProductReader.readBandRasterData(Abs
tractProductReader.java:250)
        at org.esa.snap.core.gpf.common.ReadOp.computeTile(ReadOp.java:107)
        ... 25 more
Caused by: java.io.IOException: No memory left for cache!
        at javax.imageio.stream.MemoryCache.loadFromStream(Unknown Source)
        at javax.imageio.stream.MemoryCacheImageInputStream.read(Unknown Source)

        at javax.imageio.stream.ImageInputStreamImpl.readShort(Unknown Source)
        at javax.imageio.stream.ImageInputStreamImpl.readUnsignedShort(Unknown S
ource)
        at it.geosolutions.imageioimpl.plugins.tiff.TIFFIFD.initialize(TIFFIFD.j
ava:237)
        at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageMetadata.initialize
FromStream(TIFFImageMetadata.java:147)
        at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.readMetadata
(TIFFImageReader.java:664)
        ... 34 more

Error: I/O error reading image metadata!

This reply has nothing to do with the title of this thread. For new questions you should open a new thread.

Since you did not present the xml file, it is not very clear, but your error message seems to say that you have not specified a input/output file. Either specify it in the xml-file, much better in the command itself

See this post for an example http://geoinformaticstutorial.blogspot.no/2012/03/terrain-correction-of-sar-images-part-3.html

Thanks Max, I followed your advice of using file names in the command and now it works. Your blog is really helpful!

I didn’t want to make a new topic so I’m posting here:

when I enter GPT in command line, one of my PCs shows this error and I can’t think of what is wrong:
“Native library load failed.”

Have you tried to configure GDAL? Maybe this comes from an inappropriate configuration.
I don’t see this in my SNAP, but I haven’t configured GDAL. Anyway, this error should not break gpt.

I think @ramona_manda and @kraftek should have a look at it.

thanks for the reply. GDAL actually works fine with QGIS and others. All commands are callable from the shell but somehow JAVA seems to have problems with it.
I just tried to retrieve the help reference but the error prevents proper execution of gpt in general.

Hello,
Please provide us the OS (type and version) for the computer with the problem, and also the SNAP&S2TBX version . We had a similar problem, and the source of the problem was that GDAL library integrated in SNAP (which is not related to the one installed on your computer) was compiled on a Linux that was not compatible with old versions of Linux. But this issue was fixed in the latest update (S2TBX 5.0.6). Anyway, we will investigate this issue.

thank you for the reply. I have Windows 10 64 bit. I re-installed the latest versions of the full package (SNAP 5.0 S2TBX 5.06) and all available updates to go sure that it is not a matter of version.
On a second computer with the same configuration everything is fine. Could it help to re-install GDAL and the python bindings?

Hello,
This issue it seems not to be related to your GDAL local installation, but with the GDAL library embedded in SNAP. Please try to delete the folder C:/Users/[your_user]/.snap/auxdata/gdal and restart SNAP. This operation should force SNAP to reinstall its internal GDAL library.

2 Likes

that works, thanks a lot!

1 Like