Unable to subset the corine land cover map because of its projection

I’ve downloaded the Corine 2012 Land Cover map from this link Corine:

The projection is obviously in ETRS89 (EPSG:3035)but I’m unable to make a subset of it in Snap because of the projection. Below is the error I got in Snap:

java.lang.IllegalArgumentException: illegal value for parameter 'geo_lat1': Value must be in the range -90.0 to 90.0.
	at org.esa.snap.core.param.Parameter.handleParamException(Parameter.java:487)
	at org.esa.snap.core.param.Parameter.setValue(Parameter.java:177)
	at org.esa.snap.ui.product.ProductSubsetDialog$SpatialSubsetPane.syncLatLonWithXYParams(ProductSubsetDialog.java:952)
	at org.esa.snap.ui.product.ProductSubsetDialog$SpatialSubsetPane.addGeoParameter(ProductSubsetDialog.java:824)
	at org.esa.snap.ui.product.ProductSubsetDialog$SpatialSubsetPane.initParameters(ProductSubsetDialog.java:789)
	at org.esa.snap.ui.product.ProductSubsetDialog$SpatialSubsetPane.<init>(ProductSubsetDialog.java:512)
	at org.esa.snap.ui.product.ProductSubsetDialog$SpatialSubsetPane.<init>(ProductSubsetDialog.java:487)
	at org.esa.snap.ui.product.ProductSubsetDialog.createSpatialSubsetPane(ProductSubsetDialog.java:395)
	at org.esa.snap.ui.product.ProductSubsetDialog.createUI(ProductSubsetDialog.java:357)
	at org.esa.snap.ui.product.ProductSubsetDialog.<init>(ProductSubsetDialog.java:170)
	at org.esa.snap.ui.product.ProductSubsetDialog.<init>(ProductSubsetDialog.java:148)
	at org.esa.snap.rcp.subset.CreateSubsetAction.createSubset(CreateSubsetAction.java:86)
	at org.esa.snap.rcp.subset.CreateSubsetAction.actionPerformed(CreateSubsetAction.java:64)
[catch] at org.openide.awt.InjectorExactlyOne.actionPerformed(InjectorExactlyOne.java:78)
	at org.openide.awt.ContextAction$Performer.actionPerformed(ContextAction.java:226)
	at org.openide.awt.ContextManager.actionPerformed(ContextManager.java:260)
	at org.openide.awt.ContextAction.actionPerformed(ContextAction.java:109)
	at org.openide.util.actions.ActionInvoker$1.run(ActionInvoker.java:93)
	at org.openide.util.actions.ActionInvoker.doPerformAction(ActionInvoker.java:116)
	at org.openide.util.actions.ActionInvoker.invokeAction(ActionInvoker.java:99)
	at org.openide.awt.GeneralAction$BaseDelAction.actionPerformed(GeneralAction.java:234)
	at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
	at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
	at javax.swing.AbstractButton.doClick(Unknown Source)
	at com.jidesoft.plaf.vsnet.VsnetMenuItemUI.doClick(Unknown Source)
	at com.jidesoft.plaf.vsnet.VsnetMenuItemUI$MouseInputHandler.mouseReleased(Unknown Source)
	at java.awt.Component.processMouseEvent(Unknown Source)
	at javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.awt.Component.processEvent(Unknown Source)
	at java.awt.Container.processEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.awt.EventQueue.access$500(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)

I’m unable to reproject this Geotiff file in GrassGIS to WGS84 either. Same thing with gdalwrap with the command line:

gdalwarp -s_srs “EPSG:3035” -t_srs “EPSG:27700” g100_clc12_V18_5a/g100_clc12_V18_5.tif corine-wgs84.tif

I’m not sure how to provide the csv file to the previous command (there’s a csv file inside the Legend folder provided with the land cover map). Here is the error thrown by gdalwrap:

ERROR 4: Unable to open EPSG support file gcs.csv.  Try setting the GDAL_DATA environment variable to point to the directory containing EPSG csv files.
ERROR 1: Translating source or target SRS failed

I need to reproject this image to the WGS84 projection in order to locate an area of interest there.

This problem will be fixed with the next release.
I think it is only a problem of the GUI. If you try to subset the product with gpt on the command line it should work.

Just try

gpt Subset -PgeoRegion=POLYGON((<lon1> <lat1>, <lon2> <lat2>, ..., <lon1> <lat1>)) -PcopyMetadata=true -f GeoTIFF -t "c:\eodata\output\corine.tif"

or gpt Subset -h for more help.

Thank you, from the command-line the subset operator is working well.

But I’m wondering how to reproject this subset to the standard WGS84 (EPSG:4326), as I’m unable to open the produced subset in GrassGIS for example?

This can now be done in SNAP Desktop, I think. Or also from the command line:

gpt Reproject -Pcrs=EPSG:4326 -t ...

Thanks, the Reproject operator doesn’t throw an error unless the image is too large (a 10,000 x 10,000 was too large for it). However, I tested the reprojection on a 1000x1000 image but the resulting image was completely empty. Maybe something is wrong with the parameters I’m using:

  <node id="Reproject">
    <operator>Reproject</operator>
    <sources>
      <sourceProduct refid="Read"/>
    </sources>
    <parameters class="com.bc.ceres.binding.dom.XppDomElement">
      <wktFile/>
      <crs>GEOGCS[&quot;WGS84(DD)&quot;, &#xd;
  DATUM[&quot;WGS84&quot;, &#xd;
    SPHEROID[&quot;WGS84&quot;, 6378137.0, 298.257223563]], &#xd;
  PRIMEM[&quot;Greenwich&quot;, 0.0], &#xd;
  UNIT[&quot;degree&quot;, 0.017453292519943295], &#xd;
  AXIS[&quot;Geodetic longitude&quot;, EAST], &#xd;
  AXIS[&quot;Geodetic latitude&quot;, NORTH]]</crs>
      <resampling>Nearest</resampling>
      <referencePixelX/>
      <referencePixelY/>
      <easting/>
      <northing/>
      <orientation/>
      <pixelSizeX/>
      <pixelSizeY/>
      <width/>
      <height/>
      <tileSizeX/>
      <tileSizeY/>
      <orthorectify>false</orthorectify>
      <elevationModelName/>
      <noDataValue>NaN</noDataValue>
      <includeTiePointGrids>true</includeTiePointGrids>
      <addDeltaBands>false</addDeltaBands>
    </parameters>
  </node>

Actually, 10000x10000 shouldn’t be a problem for the Reprojection.
However, could you try to remove all the empty tags. Like this one:

<parameters>
    <crs>GEOGCS["WGS84(DD)", 
      DATUM["WGS84", 
        SPHEROID["WGS84", 6378137.0, 298.257223563]], 
      PRIMEM["Greenwich", 0.0], 
      UNIT["degree", 0.017453292519943295], 
      AXIS["Geodetic longitude", EAST], 
      AXIS["Geodetic latitude", NORTH]]</crs>
    <resampling>Nearest</resampling>
    <orthorectify>false</orthorectify>
    <noDataValue>NaN</noDataValue>
    <includeTiePointGrids>true</includeTiePointGrids>
    <addDeltaBands>false</addDeltaBands>
</parameters>

Also, try the Reprojection directly from the menu. Not via the GraphBuilder.

The projected image still has invalid pos everywhere.
Another strange thing about the produced image is that its dimensions are: (1000 x 277,778), while the input image is just 1000x1000.

There is something wrong with the coordinate reference system. I think already in the original tif file from corine. maybe it is only well readable with ArcGis. I don’t know. At least QGis could not detect the CRS too. The same for SNAP. Actually, SNAP hangs when trying to open the original data. Not good.

However, luckily in QGIS you can assign the CRS manually. With the correct CRS ETRS89 I can open it in SNAP but unfortunately, I’ve lost the colour map. Don’t know why.


But I think it can be fixed with QGIS in some way.
But maybe the corine data should be updated to be better readable by other software then ArcGIS.

Yes, I actually managed to reproject it from ETRS89 (EPSG:3035) to WGS84 (EPSG:4326) using the gdalwarp command bundled with OSGeo4All. Now that it’s in the standard projection it is opening and saving well in SNAP.

1 Like