Skip to main content
Solved

RasterReplacer dynamic format

  • November 23, 2018
  • 2 replies
  • 22 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.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

takashi
Celebrity
  • 7843 replies
  • 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+37
  • Contributor
  • 2002 replies
  • 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.