Skip to main content
Question

Extract pixel from raster


danilo_fme
Evangelist
Forum|alt.badge.img+44

Hello Team,

My customer has a source data and the goal is extract just a yellow line from it.

 

The problem is when i use the transformer ( RasterCellCoercer ) after my source data the time and performance to get the polygons is not good.

 

I believe the transformer RasterExpressionEvaluator is a right solution to find these values RGB

Attachment my template file.

Thanks in Advance,

Danilo de Lima

5 replies

jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • June 12, 2017

Converting from raster to vector in FME is notoriously slow.

 

You are on the right track for ways to improve performance. If you use the RasterExpressionEvaluator to create a 1 band image where your yellow RGB value(s) have a value of 1, and everything else 0, and then set the Nodata Value to 0 (RasterBandNoDataSetter) then the coersion should be more efficient.

 

 

You can also experiment to see of the RasterExtentsCoercer (DataExtents) or RasterToPolygonCoercer is more efficient than the RasterCellCoercer for your particular data.

fmelizard
Contributor
Forum|alt.badge.img+17
  • Contributor
  • June 12, 2017

Hi @danilo_inovacao Yep you will see a vast improvement in perforamnce if you do as @jdh suggests. For your particular case you can use this expression in the RasterExpressionEvaluator (use Int8 as the

interpretation):

@if(A[0]==255 && A[1]==251 && A[2]==134,1,0)

 

 

Follow this with a RasterBandNoDataSetter to set 0 = NoData and then a RasterToPolygonCoercer to get it into vectors and Bob's your uncle! The process shouldn't take any longer than 5 seconds!

 

 


jneujens
Forum|alt.badge.img
  • June 13, 2017

The output should be a line or a polygon?

 

 

Anyway, I have experienced that a 'Generalizer' after this raster-to-vector conversion can be helpful in further processing. Just saying!

danilo_fme
Evangelist
Forum|alt.badge.img+44
  • Author
  • Evangelist
  • June 14, 2017
jdh wrote:

Converting from raster to vector in FME is notoriously slow.

 

You are on the right track for ways to improve performance. If you use the RasterExpressionEvaluator to create a 1 band image where your yellow RGB value(s) have a value of 1, and everything else 0, and then set the Nodata Value to 0 (RasterBandNoDataSetter) then the coersion should be more efficient.

 

 

You can also experiment to see of the RasterExtentsCoercer (DataExtents) or RasterToPolygonCoercer is more efficient than the RasterCellCoercer for your particular data.
Thanks @jdh . Your suggestions was very important for me :)

danilo_fme
Evangelist
Forum|alt.badge.img+44
  • Author
  • Evangelist
  • June 14, 2017
jneujens wrote:

The output should be a line or a polygon?

 

 

Anyway, I have experienced that a 'Generalizer' after this raster-to-vector conversion can be helpful in further processing. Just saying!
Hi @jneujen, the output is polygon.

 

Thanks your help :)

 


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