1

This image below worked with the GeoTIFF tools in GDAL v2. When loading it in v3 I get "proj_uom_get_info_from_database: unit of measure not found". What unit of measure isn't found, and is that by design? You can see the error with gdalinfo. I'm using GDAL v3.1.2 and proj4 v6.3.1.

Image link: https://drive.google.com/file/d/1DLZlDz-RTrruLWJQ5MbHchXj4WGn4RzU/view?usp=sharing

My old GDAL reports this:

  Raster dataset parameters:
  Projection: PROJCS["UTM Zone 10, Northern Hemisphere",GEOGCS["Unknown datum based upon the GRS 1980 ellipsoid",DATUM["unknown",SPHEROID["GRS 1980",6378137,298.2572221010042,AUTHORITY["EPSG","7019"]]],PRIMEM["Greenwich",0],UNIT[,0.0174532925199433]],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"]]]
  RasterCount: 6
  RasterSize (50,50)
Using driver GeoTIFF
  Metadata:
    0:  AREA_OR_POINT=Area
    1:  DATE_OF_CREATION=17_20 08Jul2002
    2:  DATE_OF_UPDATE=06_41 27Aug2002
    3:  FILE_ID=045025_utm10.pix
    4:  GENERATING_FACILITY=PCI Inc., Richmond Hill, Canada
    5:  SOFTWARE=PACEV6.2

  Image Structure Metadata:
    0:  INTERLEAVE=PIXEL

Corner Coordinates:
  Upper Left (729243, 5542091)
  Lower Left (729243, 5505911)
  Upper Right (764283, 5542091)
  Lower Right (764283, 5505911)
  Center (746763, 5524001)

Coordinate System is:
PROJCS["UTM Zone 10, Northern Hemisphere",
    GEOGCS["Unknown datum based upon the GRS 1980 ellipsoid",
        DATUM["unknown",
            SPHEROID["GRS 1980",6378137,298.2572221010042,
                AUTHORITY["EPSG","7019"]]],
        PRIMEM["Greenwich",0],
        UNIT[,0.0174532925199433]],
    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"]]]
Band 1 :
   DataType: Byte
   ColorInterpretation: Gray
   Description:
   Size (50,50)
   BlockSize (50,27)
   Offset: 0
   Scale: 1
Band 2 :
   DataType: Byte
   ColorInterpretation: Undefined
   Description:
   Size (50,50)
   BlockSize (50,27)
   Offset: 0
   Scale: 1
Band 3 :
   DataType: Byte
   ColorInterpretation: Undefined
   Description:
   Size (50,50)
   BlockSize (50,27)
   Offset: 0
   Scale: 1
Band 4 :
   DataType: Byte
   ColorInterpretation: Undefined
   Description:
   Size (50,50)
   BlockSize (50,27)
   Offset: 0
   Scale: 1
Band 5 :
   DataType: Byte
   ColorInterpretation: Undefined
   Description:
   Size (50,50)
   BlockSize (50,27)
   Offset: 0
   Scale: 1
Band 6 :
   DataType: Byte
   ColorInterpretation: Undefined
   Description:
   Size (50,50)
   BlockSize (50,27)
   Offset: 0
   Scale: 1
3
  • Is it a warning rather than an error? ie does it carry on doing whatever you are trying to do? I can read it into R okay, I just get that (and other) warnings, but I can do stuff like reproject it and it seems to behave.
    – Spacedman
    Aug 3, 2020 at 20:12
  • GetProjectionRef fails; it's not giving me any projection info for the image. (It will throw if I enable the C# exceptions.)
    – Brannon
    Aug 3, 2020 at 20:34
  • If you can't update to development version of GDAL could you just skip the exception in this case? I believe that GetProjectionRef gets a value with C# like it gets with Python in the example that I added into my answer.
    – user30184
    Aug 4, 2020 at 7:50

1 Answer 1

0

Your issue should have been fixed together with an existing libtiff issue https://github.com/OSGeo/libgeotiff/issues/41 via commit https://github.com/OSGeo/libgeotiff/commit/36f6ae552e8ac07a91a6c12eef400f65ef5d8b73. The fix is also made to the internal libtiff that GDAL is using with commit https://github.com/OSGeo/gdal/commit/84090e20f2da81a539798dfeb414ba619229f629. It means that the development version of GDAL does not throw that error since yesterday (2020-08-03).

The reason for the issue was that your image has a user defined GeoTIFF tag

ProjectedCSTypeGeoKey (Short,1): User-Defined

Because the key is user defined there is no corresponding row in the projections database about the units. The fix is to rely on the GeoTIFF tag that gives the units, in your case ProjLinearUnitsGeoKey (Short,1): Linear_Meter and skip the database scan that normally follows with GDAL 3

/* ------------------------------------------------------------- */

/* Search the units database for this unit. If we don't find     */   
/* it return failure.                                            */

I made a test with gdalwarp and it did convert the image correctly into EPSG:4326 even it did show the PROJ error

gdalwarp -t_srs epsg:4326 test3.tif 4326.tif
ERROR 1: PROJ: proj_uom_get_info_from_database: unit of measure not found
Creating output file that is 63P x 42L.
Processing test3.tif [1/1] : 0...10...20...30...40...50...60...70...80...90...100 - done.

Python works also even it shows the same error:

>>> cs1=raster1.GetSpatialRef()
ERROR 1: PROJ: proj_uom_get_info_from_database: unit of measure not found
>>> print cs1
PROJCS["UTM Zone 10, Northern Hemisphere",
    GEOGCS["Unknown datum based upon the GRS 1980 ellipsoid",
        DATUM["unknown",
            SPHEROID["GRS 1980",6378137,298.257222101004,
                AUTHORITY["EPSG","7019"]]],
        PRIMEM["Greenwich",0],
        UNIT["unknown",0.0174532925199433]],
    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]]

EDIT

Test with todays nighly GDAL build from gisinternals.com proves that the error has gone:

gdalinfo test3.tif
Driver: GTiff/GeoTIFF
Files: test3.tif
Size is 50, 50
Coordinate System is:
PROJCRS["UTM Zone 10, Northern Hemisphere",
    BASEGEOGCRS["Unknown datum based upon the GRS 1980 ellipsoid",
        DATUM["unknown",
            ELLIPSOID["GRS 1980",6378137,298.257222101004,
                LENGTHUNIT["metre",1],
                ID["EPSG",7019]]],
...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.