Map Projection "UTM / WGS84 (Automatic)" for Terrain Correction processing with gpt

I’m using SNAP 4.0 to make a Terrain-Correction job with the command line tool (gpt).

Making a call like this:

gpt Terrain-Correction -Ssource=/tmp/target_IW2_VV_Split_Orb_Back_ESD_Ifg_Deb_DInSAR.dim -PmapProjection=‘WGS84(DD)’

or running gpt with a graph file with the following parameters for the Terrain-Correction process:

`<node id="Terrain-Correction">
	  <sourceProduct refid="Read"/>
	<parameters class="com.bc.ceres.binding.dom.XppDomElement">
	  <demName>SRTM 3Sec</demName>
	  <incidenceAngleForSigma0>Use projected local incidence angle from DEM</incidenceAngleForSigma0>
	  <incidenceAngleForGamma0>Use projected local incidence angle from DEM</incidenceAngleForGamma0>
	  <auxFile>Latest Auxiliary File</auxFile>
</node> `

everything works fine.

I would know if I can use another type of “mapProjection”, in particular I’m interested on the “UTM / WGS84 (Automatic)” one.
If I put “UTM / WGS84 (Automatic)” in the command line call or in the graph file it doesn’t work.
I’ve also checked that, If I choose through the “SNAP GUI - Graph Builder tool” such map projection mode and I save the graph, it will generate a graph with the “mapProjection” field like this:

<mapProjection>PROJCS[&quot;UTM Zone 31 / World Geodetic System 1984&quot;, &#xd; GEOGCS[&quot;World Geodetic System 1984&quot;, &#xd; DATUM[&quot;World Geodetic System 1984&quot;, &#xd; SPHEROID[&quot;WGS 84&quot;, 6378137.0, 298.257223563, AUTHORITY[&quot;EPSG&quot;,&quot;7030&quot;]], &#xd; AUTHORITY[&quot;EPSG&quot;,&quot;6326&quot;]], &#xd; PRIMEM[&quot;Greenwich&quot;, 0.0, AUTHORITY[&quot;EPSG&quot;,&quot;8901&quot;]], &#xd; UNIT[&quot;degree&quot;, 0.017453292519943295], &#xd; AXIS[&quot;Geodetic longitude&quot;, EAST], &#xd; AXIS[&quot;Geodetic latitude&quot;, NORTH]], &#xd; PROJECTION[&quot;Transverse_Mercator&quot;], &#xd; PARAMETER[&quot;central_meridian&quot;, 3.0], &#xd; PARAMETER[&quot;latitude_of_origin&quot;, 0.0], &#xd; PARAMETER[&quot;scale_factor&quot;, 0.9996], &#xd; PARAMETER[&quot;false_easting&quot;, 500000.0], &#xd; PARAMETER[&quot;false_northing&quot;, 0.0], &#xd; UNIT[&quot;m&quot;, 1.0], &#xd; AXIS[&quot;Easting&quot;, EAST], &#xd; AXIS[&quot;Northing&quot;, NORTH]]</mapProjection>

Where the “UTM Zone” and other parameters number change depending on the input data.

I would know if there is an equivalent command line call (or mapProjection setting in graph file) to perform such adaptive “UTM / WGS84 (Automatic)” map projection selection.

System details:

  • SNAP 4.0 on CentOS release 6.5
  • 16 GB RAM
1 Like

Without testing it, I think it should work if you specify “AUTO:42001”.
It is the first entry when you chose to select a predefined CRS in the Terrain Correction UI.


Dear marpet
Thank you for your reply.
I tried to follow your suggestion, but unfortunately without success.
I tried to put as <mapProjection> field value these strings: “AUTO:42001”, “WGS 84 / AUTO UTM” and “AUTO:42001 - WGS 84 / AUTO UTM” (this last one is what the UI shows as WKT format string for the first CRS entry).

In all 3 cases gpt returns error, reported here below:

Error: [NodeId: Terrain-Correction] No code "AUTO:42001" from authority "AUTO" found for object of type "ProjectedCRS".

Error: [NodeId: Terrain-Correction] No authority was defined for code "WGS 84 / AUTO UTM". Did you forget "AUTHORITY:NUMBER"?

"AUTO:42001 - WGS 84 / AUTO UTM"
Error: [NodeId: Terrain-Correction] No code "AUTO:42001 - WGS 84 / AUTO UTM" from authority "AUTO" found for object of type "ProjectedCRS".

Thank you again for your support

P.S.: any other suggestion is very welcome :wink:

Sorry, my fault. I thought because it is working in the reprojection operator it would work also in this op. But unfortunately a piece of code is missing to make it work.
I’m not sure if Luis can fix this soon and release an update but maybe you can work around it. Is writing a little python script or a small Java program an option for you?

@lveci: I think this bit of code is missing in the CRSGeoCodingHandler


Thanks Marco, I’ll add this to the next update.

1 Like

Thank you! I can confirm that this works by setting: