Skip to main content
Solved

Error clipping raster data with polygon shapefile

  • August 29, 2017
  • 9 replies
  • 157 views

wolters
Contributor
Forum|alt.badge.img+6

Hello,

I have a lot of rasters to clip with a single polygon shapefile. As always, I use the 'clipper' function in FME in a simple workspace. But I am unable to clip the data, FME gives me the following error message:

MaskCombiner(RasterEvaluationFactory): Failed to parse the EXPRESSION_LIST clause. The provided value was 'if(B[0]==255,A[0],nan);if(B[0]==255,A[1],nan);if(B[0]==255,A[2],nan);if(B[0]==255,A[3],nan)'. Please ensure that your syntax is correct

I am guessing that something is wrong with the nodata value in my tiff files? How do I fix this issue in FME?

Thanks!

Best answer by courtney_m

As @zzupljanin, mentioned, you can try adding a transformer before clipping. Another option would be the RasterBandNoDataRemover or the RasterInterpretationCoercer. If you can attach your workspace and sample data, I can try this out.

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.

9 replies

zzupljanin
Contributor
Forum|alt.badge.img+4
  • Contributor
  • 120 replies
  • August 29, 2017

Interesting, did you try to use RasterBandNoDataSetter before clipping


takashi
Celebrity
  • 7843 replies
  • August 29, 2017
Are there some transformers that manipulate raster features, other than the Clipper? If you posted the workspace or its screenshot, it could help us to find the issue.

 

 


wolters
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • 26 replies
  • August 29, 2017
Are there some transformers that manipulate raster features, other than the Clipper? If you posted the workspace or its screenshot, it could help us to find the issue.

 

 

@takashi: No, the workspace is as easy as it gets: read in the multiband geotiff, clip using an ESRI shapefile (with one polygon), and write as a multiband geotiff in a different folder. There are no other operations. Both datasets have the same projection, too, and can be opened in QGIS with no problems.

 

 


zzupljanin
Contributor
Forum|alt.badge.img+4
  • Contributor
  • 120 replies
  • August 29, 2017
@takashi: No, the workspace is as easy as it gets: read in the multiband geotiff, clip using an ESRI shapefile (with one polygon), and write as a multiband geotiff in a different folder. There are no other operations. Both datasets have the same projection, too, and can be opened in QGIS with no problems.

 

 

can you maybe provide data sample?

courtney_m
Contributor
Forum|alt.badge.img+19
  • Contributor
  • 127 replies
  • Best Answer
  • August 29, 2017

As @zzupljanin, mentioned, you can try adding a transformer before clipping. Another option would be the RasterBandNoDataRemover or the RasterInterpretationCoercer. If you can attach your workspace and sample data, I can try this out.


mark2atsafe
Safer
Forum|alt.badge.img+56
  • Safer
  • 2554 replies
  • August 29, 2017

Looks like this is a known issue (PR#77325). Where the nodata is set to NaN (Not a Number) then there is a problem. As others have suggested, using a RasterBandNoDataSetter to change the Nodata value to an actual number is a good workaround.

If you need to follow up on this, contact our support team and let them know it is related to PR#77325


wolters
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • 26 replies
  • August 30, 2017

As @zzupljanin, mentioned, you can try adding a transformer before clipping. Another option would be the RasterBandNoDataRemover or the RasterInterpretationCoercer. If you can attach your workspace and sample data, I can try this out.

Using RasterBandNoDataRemover solved my problem, thanks @courtney_m!

 


mark2atsafe
Safer
Forum|alt.badge.img+56
  • Safer
  • 2554 replies
  • September 15, 2017

Looks like this is a known issue (PR#77325). Where the nodata is set to NaN (Not a Number) then there is a problem. As others have suggested, using a RasterBandNoDataSetter to change the Nodata value to an actual number is a good workaround.

If you need to follow up on this, contact our support team and let them know it is related to PR#77325

fyi It's been fixed in FME2018 (beta build 18170 or greater)

 


daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • 1637 replies
  • October 12, 2017

The issue with the Clipper that was causing this problem has been fixed in FME 2018, which can be downloaded from www.safe.com/download.