Skip to main content
Solved

What is the best way to validate TIFFs and TFWs files ?

  • October 18, 2017
  • 5 replies
  • 193 views

Forum|alt.badge.img

TIFF and TFW file validation

This is a bit of a cry for help as I’m still quite new to using FME.

I am looking to create a FME workbench that can validate some specific parameters for TIFF and TFW files.

  • It is a TIFF file
  • TIFF file size – This should be equal to or greater than 46MB – Equal to or less than 47MB
  • TIFF dimensions – they should be 4000 * 4000 pixels in size
  • It has three colour bands
  • It has an associated, valid TFW file

I’ll roughly have to check 100 TIFF and 100 TFW files at a time. The TIFF and TFW files have the corresponding 1KM grid reference as their names, for example I have TQ7926.tif and TQ7926.tfw.

What would be the best way to achieve this in FME? I’m happy to answer any questions to assist with the answering of my question.

Best answer by jgillespie

I've refined my fmw a fair amount now and so far it does the job. Happy to receive any feedback or suggestions on how to make it quicker or simpler.

tiff-blockvalidator-2017-v12.fmw

View original
Did this help you find an answer to your question?

5 replies

jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • October 18, 2017

The directory and file pathnames reader with retrieve file properties set to yes can get your file size.

 

The rasterPropertyExtractor transformer will give you information on the number bands, rows and columns. As a bonus it will give you the extent of the image, which is one way to check if your tfw file is valid. (ie if extent is 1-4000, then you don't have a valid tfw).

Forum|alt.badge.img
  • Author
  • October 20, 2017
jdh wrote:

The directory and file pathnames reader with retrieve file properties set to yes can get your file size.

 

The rasterPropertyExtractor transformer will give you information on the number bands, rows and columns. As a bonus it will give you the extent of the image, which is one way to check if your tfw file is valid. (ie if extent is 1-4000, then you don't have a valid tfw).

 

Is there a quicker way of checking the dimensions and extent of a TIFF than using the rasterPropertyExtractor?

 


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • October 20, 2017
jgillespie wrote:

 

Is there a quicker way of checking the dimensions and extent of a TIFF than using the rasterPropertyExtractor?

 

Not that I am aware of. You can .log the raster and then parse the logfile to get the dimensions, but I suspect that would be a lot more effort, and slower to boot.

 

 

You could get the extends using the BoundsExtractor, but I again I doubt it's any faster than the rasterPropertyExtractor.

 

 


Forum|alt.badge.img
  • Author
  • October 23, 2017
I've had ago at creating a fmw and i'd really appricate any feedback on it or suggestions to make it quicker/tidier/better. It needs to be used on a directory of folders containing TIFFs.

 

tiff-blockvalidator-2017-v01.fmw

 

 


Forum|alt.badge.img
  • Author
  • Best Answer
  • November 29, 2017

I've refined my fmw a fair amount now and so far it does the job. Happy to receive any feedback or suggestions on how to make it quicker or simpler.

tiff-blockvalidator-2017-v12.fmw


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings