Solved

Geodatabase raster nodata

  • 27 March 2018
  • 2 replies
  • 8 views

Badge

I have a raster dataset stored in a file geodatabase and when I read this into a workbench the nodata bit masks for each band are merged into a single additional alpha band named geodb_nodata as default and stated in the help documentation.

When I view the grid in the inspector Band 0 contains data values and a value of 0 or -3.40282e+38 for nodata cells. Band 1 (ALPHA8): geodb_nodata contains a value of 0 for nodata and 255 for cells containing data.

My question is how can I set the values in Band 0 as nodata using Band 1 (ALPHA8)?

I assume it's a combination of using the RasterSelector with the RasterBandNodataSetter transformers, but no combination has worked for me so far.

Specifically, I want to set the values in Band 0 to nodata using Band 1 and then sending the output to a RasterCellCoercer transformer to create points for all raster cells containing a value i.e. excluding nodata cells.

Thanks

icon

Best answer by jamess 27 March 2018, 17:12

View original

2 replies

Badge
After some more trial and error I have a solution using a RasterExpressionEvaluator followed by a RasterBandNodataSetter. The expression I've used is if(A[1] == 255,A[0],-9999) then I use the RasterBandNodataSetter to set -9999 values as NoData. This works ok, but it would be tidier to set NoData directly in the RasterExpressionEvaluator if possible.

 

 

I'd be interested in hearing other suggestions and workflows.

 

 

Userlevel 4
Badge +13
After some more trial and error I have a solution using a RasterExpressionEvaluator followed by a RasterBandNodataSetter. The expression I've used is if(A[1] == 255,A[0],-9999) then I use the RasterBandNodataSetter to set -9999 values as NoData. This works ok, but it would be tidier to set NoData directly in the RasterExpressionEvaluator if possible.

 

 

I'd be interested in hearing other suggestions and workflows.

 

 

Hi @jamess,

 

 

Thanks a lot for sharing your results with us on this workflow. It's a tricky problem here because like you've no doubt discovered the are essentially two no data values coming in from the raster here (0 and -3.40282e+38). I think the workflow you have suggested is the best workaround for this. While it seems convoluted I think it is a good approach to this particular problem.

 

Reply