OSGeo / libgeotiff

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

listgeo: fix corner coordinates for images with RasterPixelIsPoint #36

Closed CaptainCarrot closed 4 years ago

CaptainCarrot commented 4 years ago

This is a proposal to resolve the issue raised in #35, where the corner coordinates reported by listgeo are off by half a pixel if GTRasterTypeGeoKey is set to RasterPixelIsPoint instead of RasterPixelIsArea.

Currently there are no tests that use RasterPixelIsPoint, as they're RasterPixelIsArea exclusively. Should I one (or multiple)?

CaptainCarrot commented 4 years ago

A test case would be needed indeed

There is now a relatively minimal test-geotiff included that makes it easy to tell whether the behaviour is as intended. Is this sufficient?

I am also not sure whether I understand the current test-setup correctly, see the failing travis "build". Am I correcctly reading that the only failing thest is the one that compares between this and 1.5.1 because of the additional test case?

rouault commented 4 years ago

Am I correcctly reading that the only failing thest is the one that compares between this and 1.5.1 because of the additional test case?

yes, if you look at the log at https://travis-ci.com/github/OSGeo/libgeotiff/jobs/319144984 , the likely cause is that you forgot to git add & commit the new test file

rouault commented 4 years ago

@CaptainCarrot Could you commit the missing file so this PR passes ? I'd like to do a release this week

CaptainCarrot commented 4 years ago

@rouault Sorry, I have been busy with other matters. The test (./testlistgeo) works locally (silly excuse I know), and I think I have extended the test correctly here: https://github.com/OSGeo/libgeotiff/pull/36/commits/3d7b04ddc19717d945958f5527a0eda6b57c5f22

The CI failure here https://travis-ci.com/github/OSGeo/libgeotiff/jobs/319144984 seems to come from the fact that there is a new test case and image, which are not present in 1.5.1?

rouault commented 4 years ago

The CI failure here https://travis-ci.com/github/OSGeo/libgeotiff/jobs/319144984 seems to come from the fact that there is a new test case and image, which are not present in 1.5.1?

ah, I see now you committed the file, but I know what's wrong: you should add in EXTRA_DIST in test/Makefile.am, since Travis tests on the tarball generated by "make dist", and without that the file, will not be added to it