[gdal-dev] How to check whether a GRIB file uses a sphere or a spheroid?

Simon (Vsevolod) Ilyushchenko simonf at google.com
Mon Mar 23 15:46:19 PDT 2015


Turns out the GDAL driver is doing the right thing. However, many other
tools that read GRIB files default to using the spheroid regardless of what
the files specify. Consequently, many data providers don't bother switching
this setting from the default sphere to the spheroid. We tried to use the
sphere instead of the intended spheroid, which was the wrong thing to do
for the dataset in question.

On Wed, Mar 11, 2015 at 5:17 PM, Frank Warmerdam <warmerdam at pobox.com>
wrote:

> Simon,
>
> I skimmed the code and there is no actual datum support in the grib
> reader.  It does attempt to differentiate between ellipsoids and spheres so
> I assume the file actually did record things as a sphere.  Generally
> speaking it is not clear to me that the GRIB driver can actually do better
> based on the information in the files but I'd be happy to be proven wrong.
> In the meantime, it appears you will need to overwrite the geographic
> coordinate system in your ingestor.
>
> Best regards,
> Frank
>
>
> On Wed, Mar 11, 2015 at 1:25 PM, Simon (Vsevolod) Ilyushchenko <
> simonf at google.com> wrote:
>
>> Hi,
>>
>> If I use GDAL to read GRIB files like these:
>>
>> ftp://hydro1.sci.gsfc.nasa.gov/data/s4pa/NLDAS/NLDAS_NOAH0125_H.002/2015/065/NLDAS_NOAH0125_H.A20150306.1300.002.grb
>>
>> the CRS I get back is:
>> GEOGCS["Coordinate System imported from GRIB file",
>>     DATUM["unknown",
>>         SPHEROID["Sphere",6371200,0]],
>>     PRIMEM["Greenwich",0],
>>     UNIT["degree",0.0174532925199433]]
>>
>> Plotting these files shows that they are shifted 1.5 pixels north, but
>> setting CRS to EPSG:4326 that uses SPHEROID["WGS 84",6378137,298.257223563
>> instead fixes the issue.
>>
>> I'm trying to understand whether the source files incorrectly specifies
>> that it's a sphere, or whether the GDAL driver is wrong, but I cannot find
>> a GRIB reader that would show me this information about the file. What's
>> the best way to debug this?
>>
>> Thanks,
>> Simon
>>
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>>
>
>
>
> --
>
> ---------------------------------------+--------------------------------------
> I set the clouds in motion - turn up   | Frank Warmerdam,
> warmerdam at pobox.com
> light and sound - activate the windows | http://pobox.com/~warmerdam
> and watch the world go round - Rush    | Geospatial Software Developer
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20150323/168860e9/attachment.html>


More information about the gdal-dev mailing list