Gpt Mosaic : No code "AUTO:42001" from authority "AUTO" found

GPT throws this error when trying to mosaic files with the map projection “AUTO:42001” (UTM / WGS84 (Automatic)) although it works within SNAP :

Error: No code “AUTO:42001” from authority “AUTO” found for object of type “ProjectedCRS”.

There was another post about the same issue with gpt and the “Terrain-Correction” command that was resolved (Map Projection "UTM / WGS84 (Automatic)" for Terrain Correction processing with gpt) . The only difference I find is that in “Terrain-Correction”, the map projection is set in an XML tag named “mapProjection” while in “Mosaic”, the tag is named “crs”.

I am using SNAP 7 on windows 10. I used the following command :

gpt Mosaic -t Mosaic.dim -p Mosaic.xml S1A_IW_GRDH_1SSV_20150425T105410_20150425T105435_005639_00739F_CEF4_TC.dim S1A_IW_GRDH_1SSV_20150425T105435_20150425T105454_005639_00739F_2631_TC.dim

Mosaic.xml :

<parameters>
    <variables>
        <variable>
            <name>Amplitude_VV</name>
            <expression>Amplitude_VV</expression>
        </variable>
    </variables>
    <crs>AUTO:42001</crs>
    <orthorectify>false</orthorectify>
    <pixelSizeX>75.0</pixelSizeX>
    <pixelSizeY>75.0</pixelSizeY>
    <westBound>-80.62743987</westBound>
    <northBound>-6.63368693</northBound>
    <eastBound>-77.82836892</eastBound>
    <southBound>-9.82482813</southBound>
</parameters>

And here’s the complete stack trace :

org.esa.snap.core.gpf.OperatorException: No code "AUTO:42001" from authority "AUTO" found for object of type "ProjectedCRS".
        at org.esa.snap.core.gpf.common.MosaicOp.createTargetProduct(MosaicOp.java:422)
        at org.esa.snap.core.gpf.common.MosaicOp.initialize(MosaicOp.java:143)
        at org.esa.snap.core.gpf.internal.OperatorContext.initializeOperator(OperatorContext.java:486)
        at org.esa.snap.core.gpf.internal.OperatorContext.getTargetProduct(OperatorContext.java:273)
        at org.esa.snap.core.gpf.Operator.getTargetProduct(Operator.java:387)
        at org.esa.snap.core.gpf.main.CommandLineTool.runOperator(CommandLineTool.java:306)
        at org.esa.snap.core.gpf.main.CommandLineTool.runGraphOrOperator(CommandLineTool.java:284)
        at org.esa.snap.core.gpf.main.CommandLineTool.run(CommandLineTool.java:188)
        at org.esa.snap.core.gpf.main.CommandLineTool.run(CommandLineTool.java:121)
        at org.esa.snap.core.gpf.main.GPT.run(GPT.java:54)
        at org.esa.snap.core.gpf.main.GPT.main(GPT.java:34)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.esa.snap.runtime.Launcher.lambda$run$0(Launcher.java:55)
        at org.esa.snap.runtime.Engine.runClientCode(Engine.java:189)
        at org.esa.snap.runtime.Launcher.run(Launcher.java:51)
        at org.esa.snap.runtime.Launcher.main(Launcher.java:31)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:65)
        at com.exe4j.runtime.WinLauncher.main(WinLauncher.java:101)
        at com.install4j.runtime.launcher.WinLauncher.main(WinLauncher.java:26)
Caused by: org.opengis.referencing.NoSuchAuthorityCodeException: No code "AUTO:42001" from authority "AUTO" found for object of type "ProjectedCRS".
        at org.geotools.referencing.factory.wms.Code.noSuchAuthorityCode(Code.java:143)
        at org.geotools.referencing.factory.wms.Code.<init>(Code.java:95)
        at org.geotools.referencing.factory.wms.AutoCRSFactory.createProjectedCRS(AutoCRSFactory.java:198)
        at org.geotools.referencing.factory.wms.AutoCRSFactory.createCoordinateReferenceSystem(AutoCRSFactory.java:191)
        at org.geotools.referencing.factory.AuthorityFactoryAdapter.createCoordinateReferenceSystem(AuthorityFactoryAdapter.java:802)
        at org.geotools.referencing.factory.ThreadedAuthorityFactory.createCoordinateReferenceSystem(ThreadedAuthorityFactory.java:731)
        at org.geotools.referencing.DefaultAuthorityFactory.createCoordinateReferenceSystem(DefaultAuthorityFactory.java:179)
        at org.geotools.referencing.CRS.decode(CRS.java:525)
        at org.esa.snap.core.gpf.common.MosaicOp.createTargetProduct(MosaicOp.java:399)
        ... 25 more
1 Like

Hello,

this is indeed a new issue. The AUTO CRS code is currently not considered for the mosaic processing.
This is usually not big problem because when mosaicing you know the target region and therfor also the required CRS. In your case your can use EPSG:32617 or EPSG:32616. I think your region is on the border of both UTM zones.

However, I’ve created an issue (SNAP-1288) for this and we will address it in the future.

Hi,

Thank you for your answer. There are indeed workarounds for this issue : I am currently using a global map projection (EPSG 3857) because I have a process that has to work on different datasets. Still, SNAP automatically choosing an UTM zone would be nice, especially for files crossing UTM regions.