Skip to main content
Question

Extract pixel values from raster

  • April 24, 2018
  • 7 replies
  • 894 views

felipeverdu
Enthusiast
Forum|alt.badge.img+11

I would like to use the pixel values from a raster to proceed with different kind of analysis without converting to vector data. As you can see in the screenshot, in this case is the value from Band 0 (INT32) such as 50.

Best regards,

Felipe Verdú

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.

7 replies

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

Hi @felipeverdu1

 

I believe you can use the transformer RasterCellCoercer and its possible to choose the point geometry.

Thanks,

Danilo

 


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

 

There is a similar question here: Extract Pixel from Raster


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • 2252 replies
  • April 24, 2018

@felipeverdu1

You can create a point, offset or affine it by values like target_row,target_col. Using of course the raster extents (lower left corner for instance) and then use a PointOnRasterValueExtractor to extract the values at the target location.


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • 2252 replies
  • April 24, 2018

pixel-value-extraction.fmw

@felipeverdu1

You can of course control the point creation any which way you like.

Still, GDAL or PIL (for python) can do pixel-targeting without having to create geometry first.


felipeverdu
Enthusiast
Forum|alt.badge.img+11
  • Author
  • Enthusiast
  • 57 replies
  • April 25, 2018

pixel-value-extraction.fmw

@felipeverdu1

You can of course control the point creation any which way you like.

Still, GDAL or PIL (for python) can do pixel-targeting without having to create geometry first.

Thank you so much, gio! I am going to try this out.

 

 


felipeverdu
Enthusiast
Forum|alt.badge.img+11
  • Author
  • Enthusiast
  • 57 replies
  • April 25, 2018
@gio and @danilo_fme: First of all, thans for your comments. I prefer not to use vector data but raster data since this is more effective and practical in my workflow. It is like in ArcGIS/Python using raster directly.

felipeverdu
Enthusiast
Forum|alt.badge.img+11
  • Author
  • Enthusiast
  • 57 replies
  • April 25, 2018

 

There is a similar question here: Extract Pixel from Raster

Hi

 

I solved this thing using a RasterExpressionEvaluator. It was my little knowledge of implementing if statements in the expression evaluator what hinder my understanding. Thanks, @danilo_fme