Skip to main content
Solved

RasterReplacer dynamic format

  • November 23, 2018
  • 2 replies
  • 13 views

Forum|alt.badge.img

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

 

Best answer by jdh

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.

View original
Did this help you find an answer to your question?

2 replies

takashi
Influencer
  • November 24, 2018

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.


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • Best Answer
  • November 26, 2018

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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings