Auto UTM zone in the graph file?

Is there a way to specify “auto” UTM zone in the XML graph file and have gpt substitute the appropriate zone for the asset? I can compute the zone myself every time and change the XML file before running GPT, but I’d like to avoid duplicating what the toolbox already can do for me.

Thanks,
Simon

I was curious how UTM zone works in case of irregular zones 30V, 31V, 32V, 31X, 33X, 35X, and 37X

Asset S1A_EW_GRDM_1SDH_20160113T143932_20160113T144036_009477_00DBFD_1EDF is right over Svalbard. The result of doing TC on it has the following WKT:

PROJCS[“WGS 84 / TMzn35N”,
GEOGCS[“WGS 84”,
DATUM[“WGS_1984”,
SPHEROID[“WGS 84”,6378137,298.257223563,
AUTHORITY[“EPSG”,“7030”]],
AUTHORITY[“EPSG”,“6326”]],
PRIMEM[“Greenwich”,0],
UNIT[“degree”,0.0174532925199433],
AUTHORITY[“EPSG”,“4326”]],
PROJECTION[“Transverse_Mercator”],
PARAMETER[“latitude_of_origin”,0],
PARAMETER[“central_meridian”,27],
PARAMETER[“scale_factor”,0.9996],
PARAMETER[“false_easting”,500000],
PARAMETER[“false_northing”,0],
UNIT[“metre”,1,
AUTHORITY[“EPSG”,“9001”]],
AUTHORITY[“EPSG”,“4037”]]

This WKT has the correct central_meridian, but its name is interesting - EPSG:4037 is defined for Moldova: https://epsg.io/4037

This probably makes no practical difference, but I wonder what the standard way of setting WKT for the irregular UTM zones is.

The automatic UTM zone reprojection should work if you specify AUTO:42001 as crs parameter.
In the reprojection dialog you can see that there are three more automatic reprojection codes. Enable Predefined CRS and then click on Select…. In the dialog the codes are listed.

I did AUTO:42001 as crs parameter AUTO:42001 as crs parameter, but it is still
GTCITATIONGEOKEY
STRING ‘WGS 84 / TMzn36N’
PROJECTEDCSTYPEGEOKEY
INT 4038

How to change to
GTCITATIONGEOKEY
STRING ‘WGS 84 / UTM 36N’
PROJECTEDCSTYPEGEOKEY
INT 4037

If you know the UTM zone then you can use EPSG:32636, otherwise there is no way to change this.
I think the EPSG:4038 and EPSG:32636 projections are technically equal, just the names are different.
I don’t know why the auto-detection thinks the one for Moldova is better. We rely here on a library. Might be that it gets better with the next release.
I’ve noted it, so we will take care of it (SNAP-740).

2 posts were split to a new topic: When do we need Apply-Orbit file

I am trying to automate processing of S1 GRD products using the gpt command line tool.
For this purpose I am using an .xml template that I obtained from SNAP GUI, and with a python script I am modifying the input and output read/write fields and then calling gpt graph.xml on the newly created xml graph.

I tried to generate a template from SNAP, selecting AUTO UTM, but that doesn’t work when I use that graph as a template and change the filename with that of a product that needs to be projected in a different UTM zone (relatively to the product that was in the GUI when I created the graph).
How does the AUTO UTM works? Is it possible to insert a string in the xml graph such that gpt will figure out the correct UTM zone for the given product?
And I mean, manually setting the <mapProjection> field in the graph, not by using the GUI.

Thanks

have you tried this?

I don’t see any crs parameter field in the xml file… so I don’t understand how I am supposed to set it. (sorry, I am new to SNAP and projections, so I am a bit confused)

Currently this is my Terrain-Correction node in the xml graph:

  <node id="Terrain-Correction">
    <operator>Terrain-Correction</operator>
    <sources>
      <sourceProduct refid="Calibration"/>
    </sources>
    <parameters class="com.bc.ceres.binding.dom.XppDomElement">
      <sourceBands/>
      <demName>SRTM 1Sec HGT</demName>
      <externalDEMFile/>
      <externalDEMNoDataValue>0.0</externalDEMNoDataValue>
      <externalDEMApplyEGM>true</externalDEMApplyEGM>
      <demResamplingMethod>BILINEAR_INTERPOLATION</demResamplingMethod>
      <imgResamplingMethod>BILINEAR_INTERPOLATION</imgResamplingMethod>
      <pixelSpacingInMeter>10.0</pixelSpacingInMeter>
      <pixelSpacingInDegree>8.983152841195215E-5</pixelSpacingInDegree>
      <mapProjection>PROJCS[&quot;WGS 84 / Auto UTM&quot;,
  GEOGCS[&quot;WGS84(DD)&quot;,
    DATUM[&quot;WGS84&quot;,
      SPHEROID[&quot;WGS84&quot;, 6378137.0, 298.257223563]],
    PRIMEM[&quot;Greenwich&quot;, 0.0],
    UNIT[&quot;degree&quot;, 0.017453292519943295],
    AXIS[&quot;Geodetic longitude&quot;, EAST],
    AXIS[&quot;Geodetic latitude&quot;, NORTH]],
  PROJECTION[&quot;Transverse_Mercator&quot;],
  PARAMETER[&quot;central_meridian&quot;, 3.0],
  PARAMETER[&quot;latitude_of_origin&quot;, 0.0],
  PARAMETER[&quot;scale_factor&quot;, 0.9996],
  PARAMETER[&quot;false_easting&quot;, 500000.0],
  PARAMETER[&quot;false_northing&quot;, 0.0],
  UNIT[&quot;m&quot;, 1.0],
  AXIS[&quot;Easting&quot;, EAST],
  AXIS[&quot;Northing&quot;, NORTH]]</mapProjection>
      <alignToStandardGrid>false</alignToStandardGrid>
      <standardGridOriginX>0.0</standardGridOriginX>
      <standardGridOriginY>0.0</standardGridOriginY>
      <nodataValueAtSea>false</nodataValueAtSea>
      <saveDEM>false</saveDEM>
      <saveLatLon>false</saveLatLon>
      <saveIncidenceAngleFromEllipsoid>true</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>

This was generated in the SNAP GUI with a belgian tile (UTM zone 31N), now if I take the same graph, change the read and write filenames (with a script, not the GUI) in order to process a tile in another UTM zone, if I run gdalinfo on the processed product I see that it’s in UTM 31N…
What I would like to do is process a batch of files from different UTM zones, and have gpt figure out the correct UTM zone for the projection, without going through the GUI.
Another way to do this would be reading metadata from my GRD product and figure out the correct UTM zone from the geo location, and then automatically substituting the WKT string in the xml graph with a script.
I am trying to understand if it’s possible to achieve this in a simpler manner using AUTO UTM…

it should be sufficient to replace it by

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