Solved

How to use the feature extents as an environment variable for processing?


Badge

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?

icon

Best answer by hollyatsafe 4 July 2018, 17:47

View original

4 replies

Badge +3

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

Badge +2

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.

Badge

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. :-)
Userlevel 2
Badge +17

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