Skip to main content
Question

Extract pixel from raster

  • June 12, 2017
  • 5 replies
  • 492 views

danilo_fme
Celebrity
Forum|alt.badge.img+51

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

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

jdh
Contributor
Forum|alt.badge.img+37
  • Contributor
  • 2002 replies
  • 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
Safer
Forum|alt.badge.img+20
  • Safer
  • 3719 replies
  • 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
  • 189 replies
  • 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
Celebrity
Forum|alt.badge.img+51
  • Author
  • Celebrity
  • 2077 replies
  • June 14, 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.
Thanks @jdh . Your suggestions was very important for me :)

danilo_fme
Celebrity
Forum|alt.badge.img+51
  • Author
  • Celebrity
  • 2077 replies
  • June 14, 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!
Hi @jneujen, the output is polygon.

 

Thanks your help :)