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

Frank Warmerdam warmerdam at pobox.com
Wed Mar 11 17:17:00 PDT 2015


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/20150311/a4c2d977/attachment.html>


More information about the gdal-dev mailing list