Solved

RasterReplacer dynamic format

  • 23 November 2018
  • 2 replies
  • 7 views

Badge

Hi,

Is it possible to set RasterReplacer raster format from attribute value ?

Raster format has already been detected and saved in an csv file with raster filename.

i want to read this csv file resample raster and save it.

thanks in advance

 

icon

Best answer by jdh 26 November 2018, 18:44

View original

2 replies

Userlevel 2
Badge +17

I don't think there is a way to pass an attribute value to the Format parameter in the RasterReplacer.

A workaround is, assuming that you know all possible raster format, put multiple RasterReplacers for each format and use a filter transformer (e.g. TestFilter) to route the feature to an appropriate RasterReplacer according to the attribute value.

A bit tedious and maybe looks redundant, but it should work.

Badge +22

While takashi's solution is unfortunately the only work around for multiple formats in the rasterReplacer, I'm not sure why you need one in the scenario read csv file to get raster name/format, resample , write file.

I would approach this using a csv reader, featureReader set to Generic (Any format) with the reader parameter Input Format set to an attribute containing the short name of the format (from the csv), resampler, and then featureWriter set to Generic.

Reply