OSGeo / libgeotiff

Official repository of the libgeotiff project
180 stars 69 forks source link

proj_uom_get_info_from_database: unit of measure not found #41

Closed metamatic closed 4 years ago

metamatic commented 4 years ago

I've upgraded to GDAL 3.0.4 and libgeotiff 5.0.1 (packages from Ubuntu 18.04 LTS to 20.04 LTS) and all my software that uses OGRSpatialReference to perform coordinate transformation on GeoTIFF data sets is now broken. Basically when opening a data set (also via gdalinfo) I get: proj_create_from_database: prime meridian not found proj_uom_get_info_from_database: unit of measure not found

I've cloned the latest source and built libgeotiff myself. Now on version 5.1.0 I get only: proj_uom_get_info_from_database: unit of measure not found

so still unable to use the conversion functionalities.

heres the output of gdalinfo for this issue (with 5.1.0) (color palette is removed for convenience)

Driver: GTiff/GeoTIFF Files: gbr_lfc-day_gsgs_20130919_lcc.tif Size is 18004, 24604 proj_uom_get_info_from_database: unit of measure not found Coordinate System is: PROJCRS["Lambert Conformal Conic; WGS84; WGS84", BASEGEOGCRS["WGS_1984", DATUM["World Geodetic System 1984", ELLIPSOID["WGS 84",6378137,298.257223563, LENGTHUNIT["metre",1]], ID["EPSG",6326]], PRIMEM["Greenwich",0, ANGLEUNIT["unknown",0.0174532925199433]]], CONVERSION["Lambert Conic Conformal (2SP)", METHOD["Lambert Conic Conformal (2SP)", ID["EPSG",9802]], PARAMETER["Latitude of false origin",54.375, ANGLEUNIT["degree",0.0174532925199433], ID["EPSG",8821]], PARAMETER["Longitude of false origin",-3.3, ANGLEUNIT["degree",0.0174532925199433], ID["EPSG",8822]], PARAMETER["Latitude of 1st standard parallel",57.3333333333333, ANGLEUNIT["degree",0.0174532925199433], ID["EPSG",8823]], PARAMETER["Latitude of 2nd standard parallel",49.3333333333333, ANGLEUNIT["degree",0.0174532925199433], ID["EPSG",8824]], PARAMETER["Easting at false origin",0, LENGTHUNIT["metre",1], ID["EPSG",8826]], PARAMETER["Northing at false origin",0, LENGTHUNIT["metre",1], ID["EPSG",8827]]], CS[Cartesian,2], AXIS["easting",east, ORDER[1], LENGTHUNIT["metre",1, ID["EPSG",9001]]], AXIS["northing",north, ORDER[2], LENGTHUNIT["metre",1, ID["EPSG",9001]]]] Data axis to CRS axis mapping: 1,2 Origin = (-354481.960000000020955,661473.700000000069849) Pixel Size = (50.000000000000000,-50.000000000000000) Metadata: AREA_OR_POINT=Area TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch) TIFFTAG_XRESOLUTION=254 TIFFTAG_YRESOLUTION=254 Image Structure Metadata: COMPRESSION=LZW INTERLEAVE=BAND Corner Coordinates: Upper Left ( -354481.960, 661473.700) ( 9d39'44.27"W, 60d10'13.56"N) Lower Left ( -354481.960, -568726.300) ( 8d 9'41.01"W, 49d 8'45.62"N) Upper Right ( 545718.040, 661473.700) ( 6d27'33.75"E, 59d58'40.26"N) Lower Right ( 545718.040, -568726.300) ( 4d10' 5.65"E, 48d59'51.66"N) Center ( 95618.040, 46373.700) ( 1d48'37.91"W, 54d47' 0.74"N)

rouault commented 4 years ago

This may be have been resolved in libgeotiff 1.6.0 per https://github.com/OSGeo/libgeotiff/commit/e06625c4e5bcce9f9217d1d5a43dc6af73156283

metamatic commented 4 years ago

Checked on 1.6.0 and the issue is still there. 1.6.0 fixes proj_create_from_database: prime meridian not found but not proj_uom_get_info_from_database: unit of measure not found.

rouault commented 4 years ago

Can you attach the geotiff file ?

metamatic commented 4 years ago

It's > 200MB

rouault commented 4 years ago

Just post the output of "listgeo the.tif" then

metamatic commented 4 years ago

TIFFReadDirectory: Warning, Unknown field with tag 33918 (0x847e) encountered. TIFFFetchNormalTag: Warning, ASCII value for tag "GeoASCIIParams" does not end in null byte. Geotiff_Information: Version: 1 Key_Revision: 1.2 Tagged_Information: ModelTiepointTag (2,3): 0 0 0
-354481.96 661473.7 0
ModelPixelScaleTag (1,3): 50 50 0
End_Of_Tags. Keyed_Information: GTModelTypeGeoKey (Short,1): ModelTypeProjected GTRasterTypeGeoKey (Short,1): RasterPixelIsArea ProjMethodGeoKey (Short,1): CT_LambertConfConic_2SP ProjectionGeoKey (Short,1): User-Defined GeodeticDatumGeoKey (Short,1): Code-6326 (World Geodetic System 1984) EllipsoidGeoKey (Short,1): Code-7030 (WGS 84) ProjNatOriginLongGeoKey (Double,1): -3.3
ProjNatOriginLatGeoKey (Double,1): 54.375
ProjFalseEastingGeoKey (Double,1): 0
ProjFalseNorthingGeoKey (Double,1): 0
ProjStdParallel1GeoKey (Double,1): 57.3333333333333 ProjStdParallel2GeoKey (Double,1): 49.3333333333333 ProjectedCitationGeoKey (Ascii,38): "Lambert Conformal Conic; WGS84; WGS84" ProjectedCRSGeoKey (Short,1): User-Defined ProjLinearUnitsGeoKey (Short,1): Code-9001 (metre) End_Of_Keys. End_Of_Geotiff.

Projection Method: CT_LambertConfConic_2SP ProjFalseOriginLatGeoKey: 54.375000 ( 54d22'30.00"N) ProjFalseOriginLongGeoKey: -3.300000 ( 3d18' 0.00"W) ProjStdParallel1GeoKey: 57.333333 ( 57d20' 0.00"N) ProjStdParallel2GeoKey: 49.333333 ( 49d20' 0.00"N) ProjFalseEastingGeoKey: 0.000000 m ProjFalseNorthingGeoKey: 0.000000 m Datum: 6326/World Geodetic System 1984 Ellipsoid: 7030/WGS 84 (6378137.00,6356752.31) Projection Linear Units: 9001/metre (1.000000m)

Corner Coordinates: Upper Left ( -354481.960, 661473.700) ( 9d39'44.27"W, 60d10'13.56"N) Lower Left ( -354481.960, -568726.300) ( 8d 9'41.01"W, 49d 8'45.62"N) Upper Right ( 545718.040, 661473.700) ( 6d27'33.75"E, 59d58'40.26"N) Lower Right ( 545718.040, -568726.300) ( 4d10' 5.65"E, 48d59'51.66"N) Center ( 95618.040, 46373.700) ( 1d48'37.91"W, 54d47' 0.74"N)

jratike80 commented 4 years ago

Similar case with user defined crs in https://gis.stackexchange.com/questions/370419/attached-image-is-missing-unit-support-in-gdal-3-and-associated-proj4.

Listgeo is

listgeo test3.tif
TIFFReadDirectory: Warning, Unknown field with tag 42112 (0xa480) encountered.
Geotiff_Information:
   Version: 1
   Key_Revision: 1.0
   Tagged_Information:
      ModelTiepointTag (2,3):
         0                 0                 0
         729243            5542091           0
      ModelPixelScaleTag (1,3):
         700.8             723.6             0
      End_Of_Tags.
   Keyed_Information:
      GTModelTypeGeoKey (Short,1): ModelTypeProjected
      GTRasterTypeGeoKey (Short,1): RasterPixelIsArea
      GTCitationGeoKey (Ascii,33): "UTM Zone 10, Northern Hemisphere"
      GeographicTypeGeoKey (Short,1): User-Defined
      GeogCitationGeoKey (Ascii,95): "GCS Name = Unknown datum based upon the GRS 1980 ellipsoid|Datum = unknown|Primem = Greenwich|"
      GeogGeodeticDatumGeoKey (Short,1): User-Defined
      GeogAngularUnitSizeGeoKey (Double,1): 0.0174532925199433
      GeogEllipsoidGeoKey (Short,1): Ellipse_GRS_1980
      GeogSemiMajorAxisGeoKey (Double,1): 6378137
      GeogInvFlatteningGeoKey (Double,1): 298.257222101004
      GeogPrimeMeridianLongGeoKey (Double,1): 0
      ProjectedCSTypeGeoKey (Short,1): User-Defined
      ProjectionGeoKey (Short,1): Proj_UTM_zone_10N
      ProjLinearUnitsGeoKey (Short,1): Linear_Meter
      End_Of_Keys.
   End_Of_Geotiff.

Projection = 16010 (UTM zone 10N)
Projection Method: CT_TransverseMercator
   ProjNatOriginLatGeoKey: 0.000000 (  0d 0' 0.00"N)
   ProjNatOriginLongGeoKey: -123.000000 (123d 0' 0.00"W)
   ProjScaleAtNatOriginGeoKey: 0.999600
   ProjFalseEastingGeoKey: 500000.000000 m
   ProjFalseNorthingGeoKey: 0.000000 m
Ellipsoid: 7019/GRS 1980 (6378137.00,6356752.31)
Projection Linear Units: 9001/metre (1.000000m)

Corner Coordinates:
Upper Left    (  729243.000, 5542091.000)
Lower Left    (  729243.000, 5505911.000)
Upper Right   (  764283.000, 5542091.000)
Lower Right   (  764283.000, 5505911.000)
Center        (  746763.000, 5524001.000)