Ticket #1941 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

INGR driver does not respect veritcal scanline orientations

Reported by: mpd Owned by: ilucena
Priority: normal Milestone: 1.5.0
Component: GDAL_Raster Version: svn-trunk
Severity: normal Keywords: INGR
Cc: warmerdam

Description

The attached file has a vertical scanline orientation.

Attachments

w68_21_22.cit Download (0.6 MB) - added by mpd 6 years ago.
Vertically oriented INGR raster

Change History

Changed 6 years ago by mpd

Vertically oriented INGR raster

Changed 6 years ago by warmerdam

  • cc warmerdam added
  • keywords INGR added
  • owner changed from warmerdam to ilucena
  • milestone set to 1.5.0

Ivan, over to you.

Changed 6 years ago by ilucena

Good point.

Your sample file is LLV and what you are saying is that the driver is not giving you the correct GeoTransform? =

-1938278049.920774, 0, 1302.089095963633 -1470053330.548775, -1302.089095963633, 0

Nine dregree rotation should give you "1" on GeoTransform?[3]. Isn't it right?

Thank you for pointing that out. I am going to work on that.

But for the other 6 possible orientation there is not much we can do besides adding a Metadata item. I am going to do that too.

"""Intergraph has chosen Upper-Left-Horizontal (ULH) and Lower-Left-Vertical (LLV) as the default orientations. These two orientations differ only in a 90 degree rotation relative to the image content.""" [Intergraph Raster File Format Reference Guide]

Changed 6 years ago by ilucena

  • status changed from new to closed
  • resolution set to fixed

Martin,

The Intergraph Raster File Format Reference Guide mentions:

"""To obtain full transformation from local coordinates to world coordinates, catenate the homogeneous transformation matrix (TRN) with a flip matrix (T=TRN * FLIP). The concatenated matrix (T) now contains all the information required to map a particular pixel to the world coordinate system including the scanline orientation (SLO)."""

I added one Flip Matrix for each Scanline Orientation and a function to multiply those matrix to the homogeneous transformation matrix, just as the document indicates.

I applied that technique to your data sample (LLV) and the results as far I could see are very good. I don't have more data sample to test it further.

You if you don't mind, take a look in those Flip Matrix and compare with your previous implementation:

http://trac.osgeo.org/gdal/browser/trunk/gdal/frmts/ingr/IngrTypes.cpp#L118

Let me know if you find anything incorrect.

Thanks,

Ivan

Changed 6 years ago by mpd

The GeoTransform looks OK now, but the band dimensions in X and Y are not flipped.

Changed 6 years ago by ilucena

Martin,

I can be wrong but I believe that the dimensions of the raster matrix should not change, since the driver is not flipping the image, it is only documenting it so that the applications would how to handle it.

I tell you what I did. I loaded your file in ArcMap? 9.2 and it shows you image correctly in a horizontal aspect. Then I used gdal_translate to create a GeoTiff? and a HFA version of the same data and all three images overlap perfectly. Before the fix gdal_translate was generating the .tif and .img as an upside down image.

Thanks for your help,

Ivan

Changed 6 years ago by mpd

Sorry, you're right, our misunderstanding.

Note: See TracTickets for help on using tickets.