[GRASS-dev] i.modis key error 'datum'

Apparently i.modis won't run if the current projection definition does
not have the 'datum' defined. I.e., in a location like,

g.proj -p
-PROJ_INFO-------------------------------------------------
name       : clark66
ellps      : clark66
proj       : ll
no_defs    : defined
-PROJ_UNITS------------------------------------------------
unit       : degree
units      : degrees
meters     : 1.0

it will fail:

i.modis.import input=MOD11A1.A2016174.h18v04.006.2016240225941.hdf
Traceback (most recent call last):
  File "/home/user/.grass7/addons/scripts/i.modis.import", line 607, in <module>
    sys.exit(main())
  File "/home/user/.grass7/addons/scripts/i.modis.import", line 559, in main
    single(options, remove, analyze, over, outfile)
  File "/home/user/.grass7/addons/scripts/i.modis.import", line 360, in single
    projObj = projection()
  File "/home/user/.grass7/addons/etc/i.modis/rmodislib.py", line 353, in __init__
    if self.proj['datum']:
KeyError: 'datum'

Should the error message be improved, i.e. provide a clue to "switch" to
another location?

Nikos

On Mon, Sep 24, 2018 at 4:29 PM Nikos Alexandris
<nik@nikosalexandris.net> wrote:

Apparently i.modis won't run if the current projection definition does
not have the 'datum' defined. I.e., in a location like,

g.proj -p
-PROJ_INFO-------------------------------------------------
name       : clark66
ellps      : clark66
proj       : ll
no_defs    : defined
-PROJ_UNITS------------------------------------------------
unit       : degree
units      : degrees
meters     : 1.0

... besides error catching in i.modis, how was that location created?

Markus

Nikos Alexandris:

Apparently i.modis won't run if the current projection definition does
not have the 'datum' defined. I.e., in a location like,

g.proj -p
-PROJ_INFO-------------------------------------------------
name       : clark66
ellps      : clark66
proj       : ll
no_defs    : defined
-PROJ_UNITS------------------------------------------------
unit       : degree
units      : degrees
meters     : 1.0

Markus Neteler:

... besides error catching in i.modis, how was that location created?

Actually, using a file from https://zenodo.org/record/1135230:

grass -c LST_2016_07_avg.tif /geo/grassdb/lst/modis_lst

and `g.proj -p` will return the above projection details.

Nikos

On Tue, Sep 25, 2018 at 11:40 AM Nikos Alexandris
<nik@nikosalexandris.net> wrote:

Nikos Alexandris:

>> Apparently i.modis won't run if the current projection definition does
>> not have the 'datum' defined. I.e., in a location like,
>> ```
>> g.proj -p
>> -PROJ_INFO-------------------------------------------------
>> name : clark66
>> ellps : clark66
>> proj : ll
>> no_defs : defined
>> -PROJ_UNITS------------------------------------------------
>> unit : degree
>> units : degrees
>> meters : 1.0
>> ```

Markus Neteler:

>... besides error catching in i.modis, how was that location created?

Actually, using a file from https://zenodo.org/record/1135230:

Yes, that's as explained there:

The Coordinate Reference System (CRS) is identical to the
MOD11C1/MYD11C1 product as provided by NASA. In WKT as reported by
GDAL:

GEOGCS["Unknown datum based upon the Clarke 1866 ellipsoid",
    DATUM["Not specified (based on Clarke 1866 spheroid)",
        SPHEROID["Clarke 1866",6378206.4,294.9786982138982,
            AUTHORITY["EPSG","7008"]]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433]]

Hence, following NASA - MODIS. It seems that a fix in i.modis is needed.

Markus

El mar., 25 sep. 2018 6:44, Markus Neteler <neteler@osgeo.org> escribió:

On Tue, Sep 25, 2018 at 11:40 AM Nikos Alexandris
<nik@nikosalexandris.net> wrote:

Nikos Alexandris:

Apparently i.modis won’t run if the current projection definition does
not have the ‘datum’ defined. I.e., in a location like,

g.proj -p
-PROJ_INFO-------------------------------------------------
name : clark66
ellps : clark66
proj : ll
no_defs : defined
-PROJ_UNITS------------------------------------------------
unit : degree
units : degrees
meters : 1.0

Markus Neteler:

… besides error catching in i.modis, how was that location created?

Actually, using a file from https://zenodo.org/record/1135230:

Yes, that’s as explained there:

The Coordinate Reference System (CRS) is identical to the
MOD11C1/MYD11C1 product as provided by NASA. In WKT as reported by
GDAL:

GEOGCS[“Unknown datum based upon the Clarke 1866 ellipsoid”,
DATUM[“Not specified (based on Clarke 1866 spheroid)”,
SPHEROID[“Clarke 1866”,6378206.4,294.9786982138982,
AUTHORITY[“EPSG”,“7008”]]],
PRIMEM[“Greenwich”,0],
UNIT[“degree”,0.0174532925199433]]

Hence, following NASA - MODIS. It seems that a fix in i.modis is needed.

Nikos,

Please, open a ticket for this so it doesn’t get lost in emails.

Cheers,
Vero