Ticket #2178 (new defect)

Opened 4 months ago

Last modified 2 months ago

Some drivers may be misinterpreting GDALMD_AREA_OR_POINT

Reported by: rayg Assigned to: warmerdam
Priority: normal Milestone: 1.5.2
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords: projection origin terragen leveller
Cc: moellney

Description

The following raster drivers refer to the GDALMD_AOP_POINT metadata item:

AAIGRID, GeoTIFF, DTED, USGSDEM, Leveller, Terragen

The Leveller and Terragen drivers are point data, and mistakenly assume that setting GDALMD_AOP_POINT causes a projection origin correction. They also do not reverse shift when writing.

The other drivers may be making similar mistakes. AAIGRID appears to be self-shifting the projection origin when reading but in the wrong direction.

GDALMD_AOP_POINT is not a geospatial hint; setting GDALMD_AOP_POINT means only that the original data was scanned in using point rather than area samples. All drivers should strictly place the projection origin at the upper left corner of the upper left pixel, and quietly shift the projection origin by a half-pixel when performing I/O on point data.

Change History

01/27/08 17:48:13 changed by warmerdam

  • keywords changed from projection origin to projection origin terragen leveller.
  • component changed from default to GDAL_Raster.
  • milestone set to 1.5.1.

Ray,

I have no reason to believe there are problems with with the dted, usgsdem and aaigrid drivers. Please point it out if you have a specific reason to believe there is.

There are differences of opinion on whether the GeoTIFF driver ought to offset pixel-as-point origins by half a pixel. Currently the driver does not, which is my interpretation of proper behavior. This issue is addressed via other tickets.

That leaves the Leveller and Terragen drivers in need of correction. Will you be taking care of them?

01/27/08 18:17:51 changed by rayg

Section 2.5.2 of the GeoTIFF spec at http://www.remotesensing.org/geotiff/spec/geotiff2.5.html#2.5.2

clearly states that RasterPixelIsPoint? is geospatially different than RasterPixelIsArea?. Therefore the GeoTIFF driver is in error.

Lev/Terragen drivers: yes, I'll be fixing those.

01/27/08 20:00:25 changed by rayg

Leveller and Terragen drivers have been updated for the 1.5 branch.

01/28/08 01:42:04 changed by moellney

  • cc set to moellney.

01/28/08 01:52:47 changed by moellney

  • cc deleted.

Replying to rayg: (...munch...)

The other drivers may be making similar mistakes. AAIGRID appears to be self-shifting the projection origin when reading but in the wrong direction.

Maybe the infos at:

http://geotools.codehaus.org/ArcInfo+ASCII+Grid+format (last section on page seems to very clear on this topic) http://www.anuva.de/service_arcforum.php?action=vthread&forum=2&topic=2866 http://www.csc.noaa.gov/crs/tcm/instructions.html#binaryrasters

can gibe some support in the analyzing of the ARC ASCII grid driver. Btw. I do not have the impression there is a wrong shifting (at least in the Open method.) Only the interpretation of the meta data from the georeferencing seems to go to far.

Please note also that #2128 had a complain about the AAIGRID driver, too. But this was closed due to a wrongly (99% probability) generated file form geoengine.nima.mil.

01/28/08 02:04:00 changed by moellney

  • cc set to moellney.

sorry for all this cc'ing.

01/28/08 02:28:53 changed by rayg

Good info, it looks 100% clear that if xllcenter/yllcenter are in an AAIGRID header, then geospatial pixels-as-points is intended. I think the origin shift is valid, I was confused by the vertical inversion. So AAIGRID should be alright.

02/02/08 03:27:23 changed by rayg

Confirmed error in BT (binary terrain) driver; it is a point format but is not origin shifting. Offered to fix it for Ben Discoe or he may apply a fix.

DTED looks okay; origin shift is being done in a secondary module.

02/07/08 20:04:23 changed by rayg

BT driver fixed for 1.5 branch. -- Ray

03/08/08 08:28:06 changed by warmerdam

  • priority changed from high to normal.

Ray,

What is outstanding on this ticket? I'm downgrading to Normal priority since there does not seem to be critical fixes we would hold up a release for here.

03/08/08 14:05:35 changed by rayg

Only thing left is the GeoTIFF driver. I've hacked my local copy, but last time we spoke you weren't sure you wanted to update it.