[gdal-dev] gdalwarp different behavior for tif and netCDF files

B H hemantbist at gmail.com
Thu Mar 7 10:06:48 PST 2024


I am trying to reproject a netCDF file which is in Lat Lon (EPSG:4326)
projection to EPSG:3857 (Google mercator) (on GDAL 3.4.3, released
2022/04/22).
If I reproject to a tif file, it is reprojected correctly. If I reproject
to a nc file it reproject incorrectly/different location that tif file. I
am giving the commands I ran below.
Correctness is determined by viewing them in QGIS: (All tif files show up
at exactly same location as   a_stamped_latlon.nc. agoog.nc show up at a
different location ).

I will be happy to post the sample files [The only way I know to send files
to open a bug, but very likely its some details I don't know about
different formats].: a.nc is only 42KB.

Here is how to reproduce it.

 gdalwarp -s_srs EPSG:4326 -t_srs EPSG:3857 -co COMPRESS=DEFLATE -r cubic
a.nc agoog.nc
gdalwarp -s_srs EPSG:4326 -t_srs EPSG:3857 -co COMPRESS=DEFLATE -r cubic
-co "GEOTIFF_KEYS_FLAVOR=STANDARD" agoog_std.tif
gdalwarp -s_srs EPSG:4326 -t_srs EPSG:3857 -co COMPRESS=DEFLATE -r cubic
-co "GEOTIFF_KEYS_FLAVOR=STANDARD" a.nc  agoog_std.tif

gdalwarp -s_srs EPSG:4326 -t_srs EPSG:3857 -co COMPRESS=DEFLATE -r cubic
-co "GEOTIFF_KEYS_FLAVOR=ESRI_PE" a.nc  agoog_esri.tif
gdalwarp -s_srs EPSG:4326 -t_srs EPSG:3857 -co COMPRESS=DEFLATE -r cubic
-co "GEOTIFF_KEYS_FLAVOR=STANDARD" a.nc  agoog_std.tif
gdal_translate -a_srs EPSG:4326 a.nc a_stamped_latlon.nc


GDAL 3.4.3, released 2022/04/22
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20240307/d7344779/attachment.htm>


More information about the gdal-dev mailing list