[gdal-dev] GRIB SRS sensitive to CHECK_WITH_INVERT_PROJ

Sean Gillies sean at mapbox.com
Tue Jun 2 13:29:00 PDT 2020


Hi all,

Rasterio users have reported that GRIB metadata is sensitive
to CHECK_WITH_INVERT_PROJ and I can confirm it. The examples below use
rasterio 1.1.5dev (not yet released), GDAL 3.1.0 and PROJ 7.0.1. The bounds
of the dataset are approximately the Northern Hemisphere.

$ rio info --crs ~/work/grib2/sref_arw.t09z.pgrb132.ctl.f00.grib2
PROJCS["unnamed",GEOGCS["Coordinate System imported from GRIB
file",DATUM["unnamed",SPHEROID["Sphere",6371229,0]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["latitude_of_origin",50],PARAMETER["central_meridian",253],PARAMETER["standard_parallel_1",50],PARAMETER["standard_parallel_2",50],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["Metre",1],AXIS["Easting",EAST],AXIS["Northing",NORTH]]

Now, I'm going to set CHECK_WITH_INVERT_PROJ=YES.

$ CHECK_WITH_INVERT_PROJ=YES rio info --crs
~/work/grib2/sref_arw.t09z.pgrb132.ctl.f00.grib2
WARNING:rasterio._env:CPLE_AppDefined in Unable to perform coordinate
transformations, so the correct projected geotransform could not be deduced
from the lat/long control points.  Defaulting to ungeoreferenced.
WARNING:rasterio._env:CPLE_AppDefined in Unable to perform coordinate
transformations, so the correct projected geotransform could not be deduced
from the lat/long control points.  Defaulting to ungeoreferenced.


An empty string is printed to the terminal after the second warning. Note
that behavior was different with rasterio 1.1.4, which
set CHECK_WITH_INVERT_PROJ=YES internally in an attempt to improve the
defaults.

The warning comes from
https://github.com/OSGeo/gdal/blob/2818ff0a49f65741a55b9cea79df496cc05f85e3/gdal/frmts/grib/gribdataset.cpp#L2149
.

Is this sensitivity expected?

-- 
Sean Gillies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200602/c8393ce4/attachment.html>


More information about the gdal-dev mailing list