Solved

Rasters to polygons based on values in a table

  • 29 March 2018
  • 5 replies
  • 6 views

Badge

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!

icon

Best answer by takashi 30 March 2018, 16:19

View original

5 replies

Userlevel 4
Badge +30

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

Userlevel 2
Badge +17

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.

Userlevel 4
Badge +30

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
Badge

Thanks @danilo_fme and @takashi!!

Userlevel 4
Badge +30

Thanks @danilo_fme and @takashi!!

Hi @ryanfishersk

 

Im happy to help you. :) Thanks @takashi

Reply