Skip to main content
Solved

Rasters to polygons based on values in a table

  • March 28, 2018
  • 5 replies
  • 73 views

Forum|alt.badge.img

Hello,

I have around 200 rasters (in ascii format, all in the same folder) that need to be converted into polygons based on a certain threshold pixel value (as an example, for one of the rasters the final polygon should include any pixels above 0.4). Unfortunately, the big issue is that the threshold value changes for each raster (0.4 in my example, but could be 0.5, 0.6, etc for other rasters). I have an excel table with the raster name and associated threshold value but I can't figure out how to make a workflow where the raster name is then used to lookup the matching value in the excel table and then use that value in the RasterExpressionEvaluator and subsequent RastertoPolygonCoercer transformer.

Thank you for any help!

Best answer by takashi

Hi @ryanfishersk, after merging threshold value from the Excel table to each raster according to @danilo_fme's suggestion, this workflow would create polygons representing the area above the threshold value. Assuming that the source raster is a singe band numeric raster, and doesn't have Nodata definition. If the source raster has Nodata definition, remove it with the RasterBandNodataRemover beforehand.

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.

5 replies

danilo_fme
Celebrity
Forum|alt.badge.img+51
  • Celebrity
  • 2077 replies
  • March 28, 2018

Hi @ryanfishersk

I suggest you Reader to mapping your Folder and expose the format attribute fme_basename:

After you can put another Reader - Excel and connect the Readers in transformer FeatureMerger using attributes in common:

The output port Merged will have your rasters with attribute Value ( from excel file ).

Thanks,

Danilo


takashi
Celebrity
  • 7843 replies
  • Best Answer
  • March 30, 2018

Hi @ryanfishersk, after merging threshold value from the Excel table to each raster according to @danilo_fme's suggestion, this workflow would create polygons representing the area above the threshold value. Assuming that the source raster is a singe band numeric raster, and doesn't have Nodata definition. If the source raster has Nodata definition, remove it with the RasterBandNodataRemover beforehand.


danilo_fme
Celebrity
Forum|alt.badge.img+51
  • Celebrity
  • 2077 replies
  • March 31, 2018

Hi @ryanfishersk, after merging threshold value from the Excel table to each raster according to @danilo_fme's suggestion, this workflow would create polygons representing the area above the threshold value. Assuming that the source raster is a singe band numeric raster, and doesn't have Nodata definition. If the source raster has Nodata definition, remove it with the RasterBandNodataRemover beforehand.

 

Nice work @takashi

Forum|alt.badge.img
  • Author
  • 3 replies
  • April 2, 2018

Thanks @danilo_fme and @takashi!!


danilo_fme
Celebrity
Forum|alt.badge.img+51
  • Celebrity
  • 2077 replies
  • April 2, 2018

Thanks @danilo_fme and @takashi!!

Hi @ryanfishersk

 

Im happy to help you. :) Thanks @takashi