Solved

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

  • 18 October 2017
  • 5 replies
  • 29 views

Badge

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.

icon

Best answer by jgillespie 29 November 2017, 18:28

View original

5 replies

Badge +22

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).
Badge

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?

 

Badge +22

 

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.

 

 

Badge
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

 

 

Badge

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

Reply