[gdal-dev] BAG File has Zero Pixel Size
Geoff Goehle
gjg5316 at arl.psu.edu
Wed Feb 24 14:02:54 PST 2021
Hello,
I'm relatively new to GDAL and have a question about some confusing behavior when reading BAG files using C++. I'll put more details below but the TLDR is that while working with an older version of GDAL included with Ubuntu 16.04 I was able to read a file correctly but when working with the same file on Centos 8 the x and y pixel lengths are reported as zero. I don't know if it's a problem with the data set being made for an old version of GDAL, or if something else has changed that I haven't accounted for.
The file in question is H12280_MB_1m_MLLW_Combined.bag.gz<https://data.ngdc.noaa.gov/platforms/ocean/nos/coast/H12001-H14000/H12280/BAG/H12280_MB_1m_MLLW_Combined.bag.gz> at Report for H12280 (noaa.gov)<https://www.ngdc.noaa.gov/nos/H12001-H14000/H12280.html> and I'm following the "getting-dataset-information" part of the Raster API tutorial at gdal.org (Raster API tutorial - GDAL documentation<https://gdal.org/tutorials/raster_api_tut.html#getting-dataset-information>) for C++.
When printing out the dataset information on Ubuntu 16.04 with libgdal-dev-1.11.3+dfsg-3build2 I get:
Driver: BAG/Bathymetry Attributed Grid
Size is 390x527x2
Projection is `PROJCS["UTM Zone 10, Northern Hemisphere",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9108"]],AUTHORITY["EPSG","4326"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-123],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["Meter",1]]'
Origin = (525490.000000,5287130.000000)
Pixel Size = (20.000000,-20.000000)
When printing out the dataset information from the same file on Centos 8 with gdal-devel-3.0.4-5.el8.x86_64 I get:
Driver: BAG/Bathymetry Attributed Grid
Size is 390x527x2
Projection is `PROJCS["unnamed",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-123],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH]]'
Origin = (525500.000000,5276600.000000)
Pixel Size = (0.000000,-0.000000)
In particular the Pixel Size is 0 by 0 when it should be 20 by -20. There are some other differences, like the fact that the UTM zone doesn't seem to show up in the output of the newer version, but I don't quite know what to make of it. Any advice would be appreciated.
Thanks.
Geoff.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20210224/b046c33a/attachment.html>
More information about the gdal-dev
mailing list