Opened 7 years ago

Closed 5 years ago

#3718 closed defect (fixed)

GeoRaster driver does not process ULTCoordinate

Reported by: ilucena Owned by: ilucena
Priority: normal Milestone: 1.8.0
Component: GDAL_Raster Version: svn-trunk
Severity: normal Keywords: georaster
Cc:

Description (last modified by ilucena)

If a GeoRaster object has ULTCoordinate values different than (0,0,0) the driver will report a wrong origin.

For example, if we load the same Geotiff to Oracle two times and apply the following PL/SQL to one of then:

DECLARE
  gr1 sdo_georaster;
BEGIN
  SELECT raster INTO gr1 FROM gdal_import t WHERE t.raster.rasterid = 1 FOR UPDATE;
  sdo_geor.setULTCoordinate(gr1, sdo_number_array(100, 100, 0));
  UPDATE gdal_import t SET raster = gr1 WHERE t.raster.rasterid = 1;
  COMMIT;
END;

The geoinfo report will show different information about the Origin of the image:

gdalinfo geor:scott/tiger@orcl,gdal_rdt,1
Driver: GeoRaster/Oracle Spatial GeoRaster
Files: none associated
Size is 2867, 2867
Coordinate System is:
PROJCS["WGS 84 / UTM zone 31N",
    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.01745329251994328,
            AUTHORITY["EPSG","9122"]],
        AUTHORITY["EPSG","4326"]],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",3],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    AUTHORITY["EPSG","32631"],
    AXIS["Easting",EAST],
    AXIS["Northing",NORTH]]
Origin = (423185.079072200984228,4582452.920927800238132)
Pixel Size = (3.000209277990944,-3.000209277991126)
Image Structure Metadata:
  INTERLEAVE=PIXEL
  COMPRESSION=NONE
Corner Coordinates:
Upper Left  (  423185.079, 4582452.921) (  2d 4'52.35"E, 41d23'23.79"N)
Lower Left  (  423185.079, 4573851.321) (  2d 4'56.27"E, 41d18'44.89"N)
Upper Right (  431786.679, 4582452.921) (  2d11'2.70"E, 41d23'26.58"N)
Lower Right (  431786.679, 4573851.321) (  2d11'6.18"E, 41d18'47.68"N)
Center      (  427485.879, 4578152.121) (  2d 7'59.38"E, 41d21'5.78"N)
Band 1 Block=1024x1024 Type=Byte, ColorInterp=Red
Band 2 Block=1024x1024 Type=Byte, ColorInterp=Green
Band 3 Block=1024x1024 Type=Byte, ColorInterp=Blue
gdalinfo geor:scott/tiger@orcl,gdal_rdt,2
Driver: GeoRaster/Oracle Spatial GeoRaster
Files: none associated
Size is 2867, 2867
Coordinate System is:
PROJCS["WGS 84 / UTM zone 31N",
    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.01745329251994328,
            AUTHORITY["EPSG","9122"]],
        AUTHORITY["EPSG","4326"]],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",3],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    AUTHORITY["EPSG","32631"],
    AXIS["Easting",EAST],
    AXIS["Northing",NORTH]]
Origin = (423485.099999999976717,4582152.900000000372529)
Pixel Size = (3.000209277990944,-3.000209277991126)
Image Structure Metadata:
  INTERLEAVE=PIXEL
  COMPRESSION=NONE
Corner Coordinates:
Upper Left  (  423485.100, 4582152.900) (  2d 5'5.41"E, 41d23'14.16"N)
Lower Left  (  423485.100, 4573551.300) (  2d 5'9.31"E, 41d18'35.27"N)
Upper Right (  432086.700, 4582152.900) (  2d11'15.74"E, 41d23'16.94"N)
Lower Right (  432086.700, 4573551.300) (  2d11'19.20"E, 41d18'38.04"N)
Center      (  427785.900, 4577852.100) (  2d 8'12.42"E, 41d20'56.15"N)
Band 1 Block=256x256 Type=Byte, ColorInterp=Red
Band 2 Block=256x256 Type=Byte, ColorInterp=Green
Band 3 Block=256x256 Type=Byte, ColorInterp=Blue

The explanation for Oracle GeoRaster ULTCoordinates:

"In GeoRaster, while the origin of the cell space is always at (0,0), the upper-left corner cell of the raster data itself can have a different coordinate in its cell space from the coordinate of the origin of the cell space. In other words, the integer (row, column) coordinate of the upper-left corner cell is not necessarily (0,0). The upper-left corner is called the ULTCoordinate, and its value is registered in the metadata. It basically defines the relative location of the data in the cell space. If there is a band dimension, the ULTCoordinate value is always (row,column,0). The coordinate of each cell is relative to the origin of the cell space, not to the ULTCoordinate value. The origin of the cell coordinate system might not be exactly at the ULTCoordinate value." GeoRaster Developer's Guide

The consequence is that if we load those two images on QGIS they are not going to coincide.

Change History (5)

comment:1 Changed 7 years ago by ilucena

Description: modified (diff)

comment:2 Changed 7 years ago by ilucena

Resolution: fixed
Status: newclosed

Revision r20327 takes care of that.

comment:3 Changed 5 years ago by ilucena

Resolution: fixed
Status: closedreopened

There is a misinterpretation of the ULTCoordinate row and columns. It is swapped.

comment:4 Changed 5 years ago by ilucena

Fixed in r23448.

comment:5 Changed 5 years ago by ilucena

Resolution: fixed
Status: reopenedclosed
Note: See TracTickets for help on using tickets.