Question

How to batch compare overlap raster cell value?

  • 25 June 2018
  • 6 replies
  • 12 views

Hi, I've got more than 2000 DEM files and each DEM file has at least one adjacent DEM file, and they have a overlap area. I'd like to compare cell values of these overlap areas and locate those areas which don't match.

I've already made this happen in ARCGIS model builder, but the process is very slow, I hope to improve the efficiency in FME by using parallel processing.

Here's how I did in ARCGIS model builder:

1.Create a raseter mosaic dataset in the GDB, then import all the DEM files into it and use it to minus every single DEM file by using iterator.

2.Change output raster' 0 value into nodata from step 1 by using extract attribute tool which parameter is set as "VALUE >0 OR VALUE <0".

3.Use IsNull tool to change nodata value into 1 and other value into 0.

4.Convert rasters into polygons and export thoes values equal 0, then I got not match part.

Can anybody tell how to do this in FME, which transformers are equal to the tool in ARCGIS? Thank you very much.


6 replies

Userlevel 2
Badge +17

Hi @bobo,

The simplest way to find the differing cells is to send the DEM data into a pair of RasterMosaickers. Set the first mosaicker to take the Minimum of the overlapping values and the second to take the Maximum.

Send both the mosaics into a RasterExpressionEvaluator, the minimum to input A and the other to input B. Set the expression to B[0]-A[0].

The output from the RasterExpressionEvaluator will be positive wherever the overlapping values were different and 0 where they were the same.

Use a RasterBandNoDataSetter to set Nodata to 0, then use a RasterExtentsCoercer to extract polygons from the Data Extents. This will place polygons around all the areas of different overlaps.

findmismatchedoverlaps.fmw

 

 

Hi @bobo,

The simplest way to find the differing cells is to send the DEM data into a pair of RasterMosaickers. Set the first mosaicker to take the Minimum of the overlapping values and the second to take the Maximum.

Send both the mosaics into a RasterExpressionEvaluator, the minimum to input A and the other to input B. Set the expression to B[0]-A[0].

The output from the RasterExpressionEvaluator will be positive wherever the overlapping values were different and 0 where they were the same.

Use a RasterBandNoDataSetter to set Nodata to 0, then use a RasterExtentsCoercer to extract polygons from the Data Extents. This will place polygons around all the areas of different overlaps.

findmismatchedoverlaps.fmw

 

 

Thank you, Dave. I'm gonna try it tomorrow.

 

 

Hi @bobo,

The simplest way to find the differing cells is to send the DEM data into a pair of RasterMosaickers. Set the first mosaicker to take the Minimum of the overlapping values and the second to take the Maximum.

Send both the mosaics into a RasterExpressionEvaluator, the minimum to input A and the other to input B. Set the expression to B[0]-A[0].

The output from the RasterExpressionEvaluator will be positive wherever the overlapping values were different and 0 where they were the same.

Use a RasterBandNoDataSetter to set Nodata to 0, then use a RasterExtentsCoercer to extract polygons from the Data Extents. This will place polygons around all the areas of different overlaps.

findmismatchedoverlaps.fmw

 

 

Oops, it seems that FME doesn't support ESRI GRID format. I have to converted some into GeoTiff to test it. And that's exactly what I want, thank you very much. Further more, is there anyway to attach the values of differences to the polygon feature?

 

 

Userlevel 2
Badge +17
Oops, it seems that FME doesn't support ESRI GRID format. I have to converted some into GeoTiff to test it. And that's exactly what I want, thank you very much. Further more, is there anyway to attach the values of differences to the polygon feature?

 

 

Hi @bobo,

 

To get the values for the difference, please use the RasterToPolygonCoercer instead of the RasterExtentsCoercer.

 

Hi @bobo,

 

To get the values for the difference, please use the RasterToPolygonCoercer instead of the RasterExtentsCoercer.

 

The tranformer worked, but another problem came up. I've got over 2000 DEM files and turns out that most value of their overlap areas are not the same, so I got like over 400 million features in the polygon feature and it's very hard for ARCGIS to load and display. I'm wondering if there's a way to calculate the difference and create a polygon file for each DEM file?

 

 

Userlevel 2
Badge +17
The tranformer worked, but another problem came up. I've got over 2000 DEM files and turns out that most value of their overlap areas are not the same, so I got like over 400 million features in the polygon feature and it's very hard for ARCGIS to load and display. I'm wondering if there's a way to calculate the difference and create a polygon file for each DEM file?

 

 

Hi @bobo,

 

You can run the workspace in batch - once for each DEM. However, the inputs for each DEM must include all the intersecting DEMs, to check the overlaps.

 

If you open the workspace in a text editor, the first few lines show the command line needed to run the workspace in batch.

 

If you don't already know the relationships between the DEM tiffs, you can use another workspace to determine them. Add all the Tiffs as inputs, but use a BoundingBoxReplacer right after the reader. Send a copy of the bounding box to both the inputs of a SpatialRelator with the predicate 'Requestor Overlaps Supplier. The output bounds will have a list of all the tiffs that overlap it.

 

Using an AttributeCreator and Text File writer, you could use this new workspace to make the batch file to run the first one.

 

 

Reply