Skip to content
This repository has been archived by the owner on Nov 30, 2017. It is now read-only.

BEAM Georectify module

Daniele Romagnoli edited this page Aug 14, 2013 · 1 revision

The geobatch Beam module has been created to support data Georectification through BEAM as well as result harvesting into GeoServer.

It has initially been developed to georectify NetCDF irregularly gridded dataset.

The BEAM code may be get from the geosolutions-it fork at this location: https://github.com/geosolutions-it/beam.git It contains some custom changes:

  • Switching from GT-2.7.4 to GT 8.X-SNAPSHOT to be aligned with GeoBatch 1.4-SNAPSHOT
  • Better custom coordinates management (numRows,numCols / alongTrack,acrossTrack / xc,yc / ...)
  • Custom params support for Pixel position estimators.

Just run mvn clean install as usual to build it once downloaded

Beam Georectify action

This is the main action which uses BEAM to georectify a BEAM input product through the BEAM Reprojection operation.

BeamGeorectifierConfiguration

  • dimensions

When dealing with unkonwn dimensions, BEAM produces different bands with different names by adding the dimension name as suffix followed by a progressive number. So that a fractional_cloud_cover(lat=765, lon=120, cloud_formation=3) will result as 3 different bands: fractional_cloud_cover_cloud_formation_1, fractional_cloud_cover_cloud_formation_2, fractional_cloud_cover_cloud_formation_3

The dimension configuration parameter allows to specify which dimensions (as a comma separeted values list) should be searched to do bands grouping.

  • filterVariables

This parameter allows to specify which variables (as a comma separated values list) shoul be filtered from the georectification. That list may be an inclusive list or an exclusive list. See the next param.

  • filterInclude

This parameter allows to specify whether the listed filterVariables should be the only ones to be included in the processing (filterInclude = true) or the only ones to be excluded (filterInclude = false).

  • forceCoordinates

The NetCDF UnidataImageReader only deals with (up to) 4D Datasets (T,Z,Y/LAT,X/LON) made of 2D slices. Those ND datasets requires N coordinates variables containing the data values of the coordinates of those dimensions. This parameter allows to force the creation of an auxiliary coordinate variable in case the input dimension doesn't have any associated coordinate variable)

  • outputFormat

This parameter allows to specify how to encode the result of georectification. Currently, only "NETCDF" is supported which is also the Default value

  • JAICapacity

This parameters allows to specify the Global TileCache size memory which is also used by the BEAM Graph Processing Framework (GPF).

BeamGeorectifier

This action uses BEAM to do data GeoRectification through these steps:

  1. a BEAM input product will be created on top of the input dataset
  2. depending on filtering variables the product may be refined by extracting a subproduct (with less bands)
  3. a BEAM reprojection operation will be invoked on that input product
  4. a Writer will be instantiated to store the result (At time of writing, only NetCDF writer is supported)
  5. the result will be stored to disk using that writer

BEAM GeoRectification System properties

In the original version, BEAM uses some hardcoded values to compute the georectification. These values include local approximation tile size, search radius, subsampling used for estimate points and points per side to setup the map boundaries. We have made this parameter configurable through System properties (Next step would be made them configurable by request but this may require modifying a wide number of classes on beam-core to pass down the arguments).

These are the properties you may configure:

  • org.esa.beam.searchradius : This parameter defines the squared rectangle around the estimated pixel position for a geo position (by the pixelPosEstimator).
  • org.esa.beam.subsampling : This subsampling is used to create the pixelPosEstimator. It subsamples the actual PixelGeoCoding to find the pixel position of a given lat/lon faster. First the estimator is asked and based on this result the PixelGeoCoding is further searched for the closest pixel position.
  • org.esa.beam.ppsdivider : Intention is that every ppsdivider-th pixel of the longer side is used to create the map boundary. The shorter side might be oversampled.
  • org.esa.beam.tilesize : The TiePointGrids are split into tilesize degree tiles to build an approximation for each of them.

An example of settings for the JVM Arguments to run a custom setting would be: -Dorg.esa.beam.searchradius=30 -Dorg.esa.beam.tilesize=4 -Dorg.esa.beam.subsampling=10 -Dorg.esa.beam.ppsdivider=4

More info are available on the BEAM developers forum at this link.

BeamNetCDFWriter

This is the current default writer which stores the reprojected product to disk through these steps:

  1. parse the configuration parameters (grouping dimensions, force coordinates)
  2. look for dimensions by analyzing the original input file in case the dimensions parameter have been specified. Through this step it will also gather the variables containing dimensions coordinate values.
  3. create the NetCDF file. The NetCDF creation is made through 2 phases:
  • a define phase where all dimensions, coordinates and variables are defined. During this phase, all dimensions are added, and global attributes are copied. Moreover, in case the dimensions parameter has been specified, BEAM bands are grouped by dimension. Finally output variables are created.
  • an actual data values set phase. Coordinate values are written and variables array are filled with data coming from the raster underlying the BEAM reprojected bands.

Harvest GeoServer action

This action does the harvesting of the input file by adding the specified granule to the imageMosaic store using the latest capabilities offered by GeoServer Manager. We may consider moving this action to a different geobatch module once more tested and more stable.

HarvestGeoServerActionConfiguration

The HarvestGeoServerActionConfiguration extends the standard GeoServerActionConfiguration by defining an outputFolder parameter. It specifies where to move the files before doing the harvesting. By default, ingested files are moved into a temp dir and the event queue will return the moved file. Harvesting that file from that location won't be recommended being a temporary folder. Therefore, the input file will be moved to the specified outputFolder before doing the GeoServer harvesting which uses the EXTERNAL format.

HarvestGeoServerAction

This action does the harvesting of the input file by adding the referred granules to the store specified by the storeName configuration parameter