iCOR Coordinate System in SNAP

Hello all!

I’ve managed to process a Sentinel-2 image with iCOR on SNAP 6.0 after installing the patch, however, it doesn’t look like SNAP is recognizing the coordinate system of the processed image.

With this I cannot extract the pixel values, is there any workaround to this problem?

It seems that iCOR doesn’t write a CRS to any of the output TIFFs, but they do retain knowledge of pixel size/origin coordinate, etc.

One can “Assign Projection” with QGIS (using the same EPSG as the input tile) and it should then appear in the expected location.

@icor, can this pleased be fixed to happen automatically with iCOR, or is there a setting that we are missing?

Did you try to output the icor process to a BEAM DIMAP format first and then exporting to GeoTiff in a second step?

Thanks for the suggestion, Andreas, but it seems that iCOR will always output TIFFs and doesn’t seem to adhere to SNAP’s target product writer, if provided.

oh, I didn’t know that. I just remembered that in some cases reported here, direct output to *tif products resulted in loss of metadata.

As another workaround: You could download the projection file for your results here and name them exactly as the output products. Then the projection of the rasters will be identified when opening them in a GIS: http://spatialreference.org

ICOR copies the projection information from the input file. Normally there should be therefore no issue with the projection.

Therefore we advise to check

  1. if the input image contains the projection information

  2. check if gdal-data directory is set in the environmental variables; it is best that this gdal-data directory is the ICOR one (i.e. …iCOR\bin\ac_runner\gdal_data )

  3. check if the gdal-data directory effectively exists

The iCOR-team

Hi,

I am facing the same problem after doing atmospheric correction using iCOR in SNAP, coordinate is missing. Also, I wanted to know if iCOR team is planning to include other sensors such as MERIS (especially interested), MODIS, VIIRS in future?

Thanks!
Abhi

Dear Abhi,

We are investigating the issue of the missing coordinates in the projected OLCI reflectance products. Current there are no specific plans to release an ICOR version of MERIS,MODIS or VIIRS.

The iCOR team

Hi,

Please i have the same problem after iCOR application in SNAP(OLCI reflectance products).
also, gdal-data directory is set in the environmental variables. Please help me to solve this issue?

There are following issues in icor submodule file. After changes ICOR output does contains reprojected tiff output. ICOR and SNAP was installed in ubuntu latest docker image and following command used to run ICOR

python /opt/vito/icor/src/icor.py --keep_intermediate false --cloud_average_threshold 0.23 --cloud_low_band B02 --cloud_low_threshold 0.2 --aot true --aerosol_type RURAL --aot_window_size 100 --simec false --bg_window 1 --aot_override 0.1 --ozone true --aot_override 0.1 --ozone_override 0.33 --watervapor true --wv_override 2.0 --water_band B18 --water_threshold 0.06 --output_file /home/trail2.tif --sensor S3 --apply_gains false --glint_cor false --inlandwater false --productwater false --keep_land false --keep_water true --project true --working_folder /home/icor_wd /home/S3A_OL_1_EFR____20211205T042306_20211205T042606_20211205T060845_0179_079_204_2700_LN1_O_NR_002.SEN3/xfdumanifest.xml
  1. The graph xml file to be used with gpt reprojection in icor doesn’t containing a reproject node,

/opt/vito/icor/bin/auxdata/gpt_xml/graphconvert.xml

Original file is as follows

<graph id="Graph">
  <version>1.0</version>
  <node id="Read">
    <operator>Read</operator>
    <sources/>
    <parameters class="com.bc.ceres.binding.dom.XppDomElement">
      <file>${source}</file>
    </parameters>
  </node>
  <node id="Write">
    <operator>Write</operator>
    <sources>
      <sourceProduct refid="Read"/>
    </sources>
    <parameters class="com.bc.ceres.binding.dom.XppDomElement">
      <file>${target}</file>
      <formatName>GeoTIFF</formatName>
    </parameters>
  </node>
  <applicationData id="Presentation">
<Description/>
    <node id="Read">
            <displayPosition x="37.0" y="143.0"/>
    </node>
    <node id="Write">
            <displayPosition x="39.0" y="217.0"/>
    </node>
  </applicationData>
</graph>

Edited this file into this form

<graph id="Graph">
  <version>1.0</version>
  <node id="Read">
    <operator>Read</operator>
    <sources/>
    <parameters class="com.bc.ceres.binding.dom.XppDomElement">
      <file>${source}</file>
    </parameters>
  </node>
  <node id="Reproject">
        <operator>Reproject</operator>
        <sources>
            <source>Read</source>
        </sources>
        <parameters class="com.bc.ceres.binding.dom.XppDomElement">
            <!-- UTM Automatic -->
            <crs>4326</crs>
            <resampling>Nearest</resampling>
        </parameters>
   </node>
  <node id="Write">
    <operator>Write</operator>
    <sources>
      <source>Reproject</source>
    </sources>
    <parameters class="com.bc.ceres.binding.dom.XppDomElement">
      <file>${target}</file>
      <formatName>GeoTIFF</formatName>
    </parameters>
  </node>
  <applicationData id="Presentation">
<Description/>
    <node id="Read">
            <displayPosition x="37.0" y="143.0"/>
    </node>
    <node id="Write">
            <displayPosition x="39.0" y="217.0"/>
    </node>
  </applicationData>
</graph>

After this change, ICOR now returns tif output in reprojected form

  1. Another minor change needed is in following file line 809-820 in case the icor installed in linux system, where the folder path is defined for windows style

nano /opt/vito/icor/src/icor/context.py