nypl-spacetime / nypl-warper

NYPL Map Warper
MIT License
43 stars 13 forks source link

problems with GDAL v.1.10.1 and some EXIF tags #74

Open mgiraldo opened 7 years ago

mgiraldo commented 7 years ago

If a TIFF file contains the TransferFunction EXIF tag, import from NYPL Repository fails since this tag produces an error in the gdal_translate command in lib/nypl/fetch_repo.sh that is being executed from fetch_from_image_server. The subsequent check for errors gets invoked and therefore the process fails.

Upgrading GDAL to 1.11 solves this problem but then provokes another one: the gdal_rasterize command used for cropping fails for image files that do not have geodata (it doesn't in 1.10):

ERROR 1: Unable to compute a transformation between pixel/line
and georeferenced coordinates for test.tif.
There is no affine transformation and no GCPs.

Right now I don't know how to prevent gdal_rasterize from failing this process so the only alternative is to not import TIFFs with TransferFunction EXIF tags while using GDAL 1.10.

 (•_•)
<)   )╯ LONG
 /   \ 

\(•_•) 
 (   (> LIVE
 /   \ 

 (•_•) 
<)   )> GDAL
 /   \ 
timwaters commented 7 years ago

Hmm, this could be problematic! Note that the gdal version in Ubuntu 16.04 LTS is 1.11.3

mgiraldo commented 7 years ago

correct. the original version in the servers is 1.10. upgrading to latest (1.11) fixed one thing and broke another. I had to downgrade to 1.10 (had to learn how to downgrade in Ubuntu).

¯\_(ツ)_/¯

I wonder if this problem also occurs in 2.0. couldn't figure out how to upgrade to that.

or maybe 1.11 has a flag that ignores the non-geo-ness in gdal_rasterize?

On Oct 25, 2016, at 06:24, Tim Waters notifications@github.com wrote:

Hmm, this could be problematic! Note that the gdal version in Ubuntu 16.04 LTS is 1.11.3

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

timwaters commented 7 years ago

Could be worth reaching out to the GDAL mailing list to see if it's a bug. It's not in the changelog from what I could see. I was thinking of seeing if calling Python or Ruby bindings directly to rasterize gives the same error.

mgiraldo commented 7 years ago

contacted them to see if i can get permission to post. i didn't find any issues similar to this one (dealing with non-rectified images)

mgiraldo commented 7 years ago

a possible solution is clipping after rectifying but didn't want to mess up the current process

timwaters commented 7 years ago

I used ubuntuGIS repo to install 2.1.0 but got the same error :( I've started a thread on the mailing list http://lists.osgeo.org/pipermail/gdal-dev/2016-November/045622.html

mgiraldo commented 7 years ago

crossing fingers ✌️🔀