OSGeo / libgeotiff

Official repository of the libgeotiff project
182 stars 70 forks source link

"failed to read anything" #6

Closed rw2 closed 5 years ago

rw2 commented 5 years ago

I'm trying to do something I thought would be very simple. I'm trying to use listgeo to pull the geo information out of a tiff, modify it and add it to another tiff.

listgeo results in a dump that has correct information.

For the sake of simplicity, I modify a single character in a GPS coordinate and then try to apply it back onto the tiff. When I do this I get several errors saying "geo_print.c DefaultRead failed to read anything"

rouault commented 5 years ago

This must have been fixed per https://github.com/OSGeo/libgeotiff/commit/0dba341b6ce1bf94877094a76c485b7243d68ec7 , that has been delivered in libgeotiff 1.4.3 This was just an error message, not something affecting geotifcp output.

rw2 commented 5 years ago

I suppose I should have added, if I then do a listgeo on the output file, the changes have not been applied.

rouault commented 5 years ago

Please provide a fully procedure (input data + exact commands issued) so that we can reproduce

rw2 commented 5 years ago

I'm on Ubuntu 18.04.1 and geotiff-bin V1.4.2 so let me figure out how to get a more recent build since you thought there might have been a change...

rouault commented 5 years ago

I'm on Ubuntu 18.04.1 and geotiff-bin V1.4.2 so let me figure out how to get a more recent build since you thought there might have been a change...

The change should only remove the warning, and not affect the output. So you can provide what you observe with your current version

rw2 commented 5 years ago

WI_RichlandCenter_503502_1905_125000_geo.tif.zip

unzip the attached tiff

listgeo WI_Richland\ Center_503502_1905_125000_geo.tif > t.geo

Modify t.geo. I've just been changing the last digit of one of the coordinates.

applygeo t.geo WI_Richland\ Center_503502_1905_125000_geo.tiff

listgeo WI_Richland\ Center_503502_1905_125000_geo.tif

Changes aren't evident in the file, though the timestamp does get updated.

rouault commented 5 years ago

Did you modify the coordinates in the "Corner Coordinates" section ? If so, that explains things. Everything that is after "End_Of_Geotiff" is informative only and ignored by geotifcp. So if you want to modify the coordinates you have to modify the ModelTiepointTag and/or ModelPixelScaleTag values

rw2 commented 5 years ago

You nailed it. I just looked at the file and thought it was obvious. But now you've pointed me in the right direction. Go ahead and close this one. Now I have to figure out what looks to be a far more complicated standard than I expected!