Showing results for 
Search instead for 
Do you mean 


by Technical Evangelist on ‎12-18-2019 01:14 PM - edited on ‎02-21-2020 06:51 AM by Community Manager (162 Views)

Download model


The primary purpose of this spatial model is to show how to use the new (to ERDAS IMAGINE / SMSDK 2020) Create Dice Boundaries operator to create a regular grid of area geometries over an image. This is useful for purposes such as Zonal Change Detection and Deep Learning feature extraction, especially to produce a grid not possible in those applications, such as a grid where the polygons have overlap.


Overlapping square polygons created over a satellite image

The primary use for Create Dice Boundaries was to replicate the functionary provided by the old Dice Image dialog. The Dice Image dialog takes as input an image file and a set of parameters which define how to break that image up into many equal sized and potentially overlapping chips. So the Create Dice Boundaries operator was implemented to create the boundary definitions that you might wish to use for purposes such as subsetting an image. You can find the Spatial Model which performs the Dice Image function in $IMAGINE_HOME\etc\models\diceimage.gmdx

However, in the Spatial Model presented in this article, the Create Dice Boundaries operator is instead used to create boundaries which are themselves turned into area geometries in a single output vector layer (usually a Shapefile).




The Create Dice Boundaries operator generates a List of Boundaries, not a Features stream. So the first task is to take the List of Boundaries and read it through a Features Input operator to turn the Boundaries into a Features stream. 

The Create Dice Boundaries operator also creates Boundaries (and subsequently area geometries via the Features Input) in an "image space" coordinate system (grid coordinates). So to create Features which can be overlaid with the original data, or other geospatial data, the features geometries have to be re-associated with the Coordinate Reference System (CRS) of the input image. So the Dictionary Item operator is used to mine the Metadata of the input raster to determine the value associated with its Boundary.CRS key. That is then used as the TargetCRS  input to the Coordinate Transformation operator. This transforms the "image space" coordinates into the same CRS as the input image. The area geometries can then be successfully overlaid onto the input image in a Preview or written to an output vector file for use in other tools. 


You must have Spatial Modeler 2020, or later, installed to use this Spatial Model.


Input parameters: 

Input Raster Filename: Name of the raster image to be used as the spatial extent reference from which the tile/grid area geometries will be generated.

Grid Size in Pixels: Size of the grid to create, measured in pixels of the Input Raster. For example, a value of 256 will create a grid of (by default) butt-joining area polygons covering 256 x 256 pixels starting at the lower left corner of the input image.

Percent Overlap: Defaults to 0, but a value less than 100 can be entered to define an overlap (in both vertical and horizontal directions) between successive area geometries. For example, entering 50 will create square area geometries which overlap 50% across lines and columns.

Output Grid Filename: Name of the output Shapefile to create which contains the area geometries defining the grid.