Skip to main content
Question

Exposing a raster band value and creating an attribute from it

  • January 29, 2018
  • 2 replies
  • 351 views

Forum|alt.badge.img

@takashi As you have probably worked out I'm fairly new to more than push button FME. This should be really simple and probably is but I want to expose a numeric raster band value and create an attribute from it so that when I covert the raster to polygons I have the value as an attribute of the polygons. I have tried using attribute creator but can't work out the syntax. This leads on to another probably basic and related question: I want to replace values in a raster based on ranges of numbers - eg 0-12 becomes 12 and more than 12 but less than 20 becomes 20, etc. I can string together multiple instances of RasterCellReplacer to approximate this but there must be a more efficient way using RasterExpressionEvaluator for example. Again my syntax to do this is lacking. Any resources for a self-taught FME'r on that front that start at the basics?

2 replies

takashi
Influencer
  • January 30, 2018

Hi @garethgis, "_band{0}.value" seems to be an element of a list attribute which will be created with a RasterCellCoercer, but I don't think the transformer is used in your workspace, as far as I see your screenshots.

If you need to extract individual cell values as feature attributes, consider using the RasterCellCoercer.

Alternatively, if your final goal is to create polygons each of which merged consecutive cells having the same value, the RasterToPolygonCoercer could be more efficient to accomplish the goal.


Forum|alt.badge.img
  • Author
  • January 30, 2018
takashi wrote:

Hi @garethgis, "_band{0}.value" seems to be an element of a list attribute which will be created with a RasterCellCoercer, but I don't think the transformer is used in your workspace, as far as I see your screenshots.

If you need to extract individual cell values as feature attributes, consider using the RasterCellCoercer.

Alternatively, if your final goal is to create polygons each of which merged consecutive cells having the same value, the RasterToPolygonCoercer could be more efficient to accomplish the goal.

Some of the FME tools that look logical just seem a bit of a deadend. I'd have thought that the attribute creator would logically be a reasonable way forward and working on the raster logically faster than converting every pixel to a polygon or point first. The RasterCellCoercer looks like it has the band exposer option while the raster2polygon tool has zero options and didn't automatically bring the band info through to the polygons so I guess its Coercer then merge polygons?

 

 


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