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">
	<operator>Terrain-Correction</operator>
	<sources>
	  <sourceProduct refid="Read"/>
	</sources>
	<parameters class="com.bc.ceres.binding.dom.XppDomElement">
	  <sourceBands/>
	  <demName>SRTM 3Sec</demName>
	  <externalDEMFile/>
	  <externalDEMNoDataValue>0.0</externalDEMNoDataValue>
	  <externalDEMApplyEGM>true</externalDEMApplyEGM>
	  <demResamplingMethod>BILINEAR_INTERPOLATION</demResamplingMethod>
	  <imgResamplingMethod>BILINEAR_INTERPOLATION</imgResamplingMethod>
	  <pixelSpacingInMeter>0.0</pixelSpacingInMeter>
	  <pixelSpacingInDegree>0.0</pixelSpacingInDegree>
	  <mapProjection>WGS84(DD)</mapProjection>
	  <nodataValueAtSea>true</nodataValueAtSea>
	  <saveDEM>false</saveDEM>
	  <saveLatLon>false</saveLatLon>
	  <saveIncidenceAngleFromEllipsoid>false</saveIncidenceAngleFromEllipsoid>
	  <saveLocalIncidenceAngle>false</saveLocalIncidenceAngle>
	  <saveProjectedLocalIncidenceAngle>false</saveProjectedLocalIncidenceAngle>
	  <saveSelectedSourceBand>true</saveSelectedSourceBand>
	  <outputComplex>false</outputComplex>
	  <applyRadiometricNormalization>false</applyRadiometricNormalization>
	  <saveSigmaNought>false</saveSigmaNought>
	  <saveGammaNought>false</saveGammaNought>
	  <saveBetaNought>false</saveBetaNought>
	  <incidenceAngleForSigma0>Use projected local incidence angle from DEM</incidenceAngleForSigma0>
	  <incidenceAngleForGamma0>Use projected local incidence angle from DEM</incidenceAngleForGamma0>
	  <auxFile>Latest Auxiliary File</auxFile>
	  <externalAuxFile/>
	</parameters>
</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.

2 Likes

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:

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

"WGS 84 / AUTO UTM"
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

2 Likes

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

1 Like

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

<mapProjection>AUTO:42001</mapProjection>
3 Likes