GDAL error

41 views
Skip to first unread message

Stefan Gofferje

unread,
Feb 20, 2021, 6:10:33 AM2/20/21
to sup...@opendap.org
Hi there,

I'm tinkering with GDAL at the moment, trying to learn some more GIS and
I have encountered an error message that asked me to report the error to
you. Here's the console cap:

┌─[sgofferj@enterprise][~]
└──▪ gdal_translate
https://nomads.ncep.noaa.gov/dods/gfs_0p25/gfs20210220/gfs_0p25_06z?tmp2m.tmp2m[0][y][x]
test.tif
Input file size is 1440, 721
0ERROR 1: An internal error was encountered:
Expected an Array or Grid variable!
Please report this to sup...@opendap.org

ERROR 1:
https://nomads.ncep.noaa.gov/dods/gfs_0p25/gfs20210220/gfs_0p25_06z?tmp2m.tmp2m[0][y][x],
band 1: IReadBlock failed at X offset 0, Y offset 0: An internal error
was encountered:
Expected an Array or Grid variable!
Please report this to sup...@opendap.org

My system is:
┌─[sgofferj@enterprise][~]
└──▪ uname -a
Linux enterprise 5.4.0-65-generic #73-Ubuntu SMP Mon Jan 18 17:25:17 UTC
2021 x86_64 x86_64 x86_64 GNU/Linux

and GDAL is:
┌─[sgofferj@enterprise][~]
└──▪ gdalinfo --version
GDAL 3.0.4, released 2020/01/28


Kind regards / ystävällisin terveisin,
Stefan Gofferje
______________________________________

Haukantie 2 B 5
FIN-37600 Valkeakoski
Suomi / Finland
GSM: +358 (41) 7290730
Aus Deutschland: (02151) 7476231
https://www.gofferje.net/
mailto: ste...@gofferje.net

This email is signed with a qualified certificate according to the
Finnish Act on Digital Signatures (14/2003) and the Finnish Act on
Strong Electronic Identification and Electronic Signatures (617/2009) as
well as EU directive 1999/93/EC and EU Commission decision 2003/511/EC.
It is as such legally binding and equal to a personally signed paper
document.

James Gallagher

unread,
Feb 22, 2021, 3:19:15 PM2/22/21
to Stefan Gofferje, James Gallagher, sup...@opendap.org

On Feb 20, 2021, at 04:10, Stefan Gofferje <ste...@gofferje.net> wrote:

Hi there,

I'm tinkering with GDAL at the moment, trying to learn some more GIS and I have encountered an error message that asked me to report the error to you. Here's the console cap:

┌─[sgofferj@enterprise][~]
└──▪ gdal_translate https://nomads.ncep.noaa.gov/dods/gfs_0p25/gfs20210220/gfs_0p25_06z?tmp2m.tmp2m[0][y][x] test.tif
Input file size is 1440, 721
0ERROR 1: An internal error was encountered:
Expected an Array or Grid variable!
Please report this to sup...@opendap.org

I didn’t get an error when I tried that in a browser, can you tell me more about what you did?

Thanks,
James


ERROR 1: https://nomads.ncep.noaa.gov/dods/gfs_0p25/gfs20210220/gfs_0p25_06z?tmp2m.tmp2m[0][y][x], band 1: IReadBlock failed at X offset 0, Y offset 0: An internal error was encountered:
Expected an Array or Grid variable!
Please report this to sup...@opendap.org

My system is:
┌─[sgofferj@enterprise][~]
└──▪ uname -a
Linux enterprise 5.4.0-65-generic #73-Ubuntu SMP Mon Jan 18 17:25:17 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

and GDAL is:
┌─[sgofferj@enterprise][~]
└──▪ gdalinfo --version
GDAL 3.0.4, released 2020/01/28


Kind regards / ystävällisin terveisin,
Stefan Gofferje
______________________________________

Haukantie 2 B 5
FIN-37600 Valkeakoski
Suomi / Finland
GSM:             +358 (41) 7290730
Aus Deutschland: (02151) 7476231
https://www.gofferje.net/
mailto: ste...@gofferje.net

This email is signed with a qualified certificate according to the Finnish Act on Digital Signatures (14/2003) and the Finnish Act on Strong Electronic Identification and Electronic Signatures (617/2009) as well as EU directive 1999/93/EC and EU Commission decision 2003/511/EC. It is as such legally binding and equal to a personally signed paper document.


James Gallagher



Nathan Potter

unread,
Feb 22, 2021, 5:25:04 PM2/22/21
to Stefan Gofferje, Nathan Potter, sup...@opendap.org


> On Feb 20, 2021, at 3:10 AM, Stefan Gofferje <ste...@gofferje.net> wrote:
>
> Hi there,
>
> I'm tinkering with GDAL at the moment, trying to learn some more GIS and I have encountered an error message that asked me to report the error to you. Here's the console cap:
>
> ┌─[sgofferj@enterprise][~]
> └──▪ gdal_translate https://nomads.ncep.noaa.gov/dods/gfs_0p25/gfs20210220/gfs_0p25_06z?tmp2m.tmp2m[0][y][x] test.tif
> Input file size is 1440, 721
> 0ERROR 1: An internal error was encountered:
> Expected an Array or Grid variable!
> Please report this to sup...@opendap.org
>

> ERROR 1: https://nomads.ncep.noaa.gov/dods/gfs_0p25/gfs20210220/gfs_0p25_06z?tmp2m.tmp2m[0][y][x], band 1: IReadBlock failed at X offset 0, Y offset 0: An internal error was encountered:
> Expected an Array or Grid variable!
> Please report this to sup...@opendap.org


GDAL is telling you the truth. GDAL only works with gridded data. And it all depends on how you make the subset query.

Here is your dataset:
https://nomads.ncep.noaa.gov/dods/gfs_0p25/gfs20210220/gfs_0p25_06z.dds

You asked for:
https://nomads.ncep.noaa.gov/dods/gfs_0p25/gfs20210220/gfs_0p25_06z.dds?tmp2m.tmp2m[0][0][0]

Notice that it’s no longer a Grid because you reached into the Grid variable and asked for just the data array using the constraint: tmp2m.tmp2m[0][0][0]

If you use the Grid name only, it will subset the coordinate arrays and transfer them along with the data array:
https://nomads.ncep.noaa.gov/dods/gfs_0p25/gfs20210220/gfs_0p25_06z.dds?tmp2m[0][0][0]

This should make GDAL happy (but it will not work in your browser!):

gdal_translate https://nomads.ncep.noaa.gov/dods/gfs_0p25/gfs20210220/gfs_0p25_06z?tmp2m[0][y][x]


Does that make sense?


Sincerely,

Nathan




> My system is:
> ┌─[sgofferj@enterprise][~]
> └──▪ uname -a
> Linux enterprise 5.4.0-65-generic #73-Ubuntu SMP Mon Jan 18 17:25:17 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
>
> and GDAL is:
> ┌─[sgofferj@enterprise][~]
> └──▪ gdalinfo --version
> GDAL 3.0.4, released 2020/01/28
>
>
> Kind regards / ystävällisin terveisin,
> Stefan Gofferje
> ______________________________________
>
> Haukantie 2 B 5
> FIN-37600 Valkeakoski
> Suomi / Finland
> GSM: +358 (41) 7290730
> Aus Deutschland: (02151) 7476231
> https://www.gofferje.net/
> mailto: ste...@gofferje.net
>
> This email is signed with a qualified certificate according to the Finnish Act on Digital Signatures (14/2003) and the Finnish Act on Strong Electronic Identification and Electronic Signatures (617/2009) as well as EU directive 1999/93/EC and EU Commission decision 2003/511/EC. It is as such legally binding and equal to a personally signed paper document.
>

= = =
Nathan Potter ndp at opendap.org
OPeNDAP, Inc. +1.541.231.3317

Stefan Gofferje

unread,
Feb 23, 2021, 4:05:14 AM2/23/21
to Nathan Potter, sup...@opendap.org, jgall...@opendap.org
Hi Nathan and James!

Thanks for your reply! Nathan's answer actually solved the issue for me.
I apologize for the "problem between keyboard and chair" issue!
Unfortunately, I can't find the URL from where I got the inspiration for
my GDAL call anymore. I have been trying for days to get GDAL to work
with the NOAA DODS server and visited countless URLs that Google offered me.

I'm running a free weather website for storm chasers at www.saakeskus.fi
and I have used GrADs for that for the last 13 years. Some time ago, I
started a remake (s. beta.saakeskus.fi) also still using GrADs.
I just recently used GDAL for mangling some personal hiking maps and I
was stunned how fast it was. After that, I thought, I could give GDAL a
try for my weather project and indeed, GDAL apparently does at least
basic things much faster than GrADs. The overlays at beta are already
produced with GDAL, still working off pre-downloaded GRIB2 files.

Thanks again! And I hope I can avoid further "problem between keyboard
and chair" issues on my endeavor to move to GDAL.

Kind regards / ystävällisin terveisin,
Stefan Gofferje
______________________________________

Haukantie 2 B 5
FIN-37600 Valkeakoski
Suomi / Finland
GSM: +358 (41) 7290730
Aus Deutschland: (02151) 7476231
https://www.gofferje.net/
mailto: ste...@gofferje.net

This email is signed with a qualified certificate according to the
Finnish Act on Digital Signatures (14/2003) and the Finnish Act on
Strong Electronic Identification and Electronic Signatures (617/2009) as
well as EU directive 1999/93/EC and EU Commission decision 2003/511/EC.

Reply all
Reply to author
Forward
0 new messages