Skip to main content

I have a folder of old aerial imagery tiles with .txg georeference file. Inside .txg file, there are coordinates of the four corner. 

I can manually copy those corner coordinates into the RasterGeoreferencer transformer, but is there any way to automate this process and mosaic all tiles into one raster?

What I would do:

  • Creator to initiate
  • FeatureReader Directory reader to read files.
  • Testfilter to split based on file extension.
  • TXG stream
    • FeatureReader text reader to read as text from path_windows
    • TestFilter to select lines with Upper left etc.
    • AttributeSplitter, split on space to parse line to list.
    • AttributeCreators to create UpperLeftX, UpperLeftY etc from listelements.
    • Aggregator to merge lines UpperLeft, UpperRight etc in one feature, group by filename.
  • FeatureMerger to merge parsed coordinates to features with BMP extensions.
  • FeatureReader to read BMP from path_windows, merge attributes.
  • RasterGeoreferencer based on parsed attributes UpperLeftX, UpperLeftY, etc.
  • CoordinateSystemSetter to set coordinatesystem.
  • FeatureWriter to write geotiff.

I’m going to suggest a wildly different workflow: use those txt files to create tfw files (TIFF World file).

A tfw file has the following structure:

Line 1: A: pixel size in the x-direction in map units/pixel
Line 2: D: rotation about y-axis
Line 3: B: rotation about x-axis
Line 4: E: pixel size in the y-direction in map units, almost always negative[b]
Line 5: C: x-coordinate of the center of the upper left pixel
Line 6: F: y-coordinate of the center of the upper left pixel

So for your example that would be:

0.22 0 0 -0.22 48399.89 6001999.89

You can use the Text File reader to read the text file, each line turns into a feature, and then use StringSearchers to grab the information you need from the file.

Then when FME (or other GIS software) reads the TIF file it’ll see the tfw file and automatically use that for georeferencing.

 

Edit to say I didn’t realize it was about BMP files until after I wrote all that… I should really have my coffee before answering questions here…😅  However… I think you can still use my method as well, along with a second workspace to convert BMP to TIFF