Skip to main content

I am using FME 2017 and would like to carry out a relatively simple geoprocessing task. I have DEM TIF tiles and DOM TIF tiles in 2 different directories which both have the same names and the same extents. I would like to subtract the DEM from the DOM for each tile and save the new tile in a 3rd directory named "NORMALIZED".

So my process is simply the following:

1. Iterate through Directory "DOM" and for each filename find and subtract the same file in directory "DEM".

2. Save the result in Directory "NORMALIZED"

 

How would I achieve this?

@robertdbuckley

You don't have to iterate, though might be wise if the files are very large.

You can merge on the filenames (which are the same as you stated).

And run the process on the merged port.

(Use directory and file reader with a featurereader for instance. Or 2 dynamic readers.)


Hi @robertdbuckley,

If you are looking to subtract the value of the DOM tile from the DEM file then you should be able to use the RasterCellValueCalculator transformer. If they have the same file name I think you can use the 'group by' parameter to process these all at once and then write they out to your NORMALIZED directory.


Hi @robertdbuckley,

If you are looking to subtract the value of the DOM tile from the DEM file then you should be able to use the RasterCellValueCalculator transformer. If they have the same file name I think you can use the 'group by' parameter to process these all at once and then write they out to your NORMALIZED directory.

 

This is exactly what I was looking for! Thanks. But I would still be curious to know how I could do the same using list indexes. 🙂

Hi @robertdbuckley,

I have attached a workspace that uses the FeatureReader and RasterExpressionEvaluator to do the subtraction on an entire folder of TIF files, outputting a separate TIF for each DEM/DOM pair.

batchsubtractgeotiff.fmw


Reply