User Tools

Site Tools


TGIS_GridToPolygon class

DK11 for Delphi | GisVectorization.TGIS_GridToPolygon | Classes | Constructors | Methods | Properties

Class that enables grid to vector (polygon) conversion.

Available also on: .NET | Java | ActiveX.


// Delphi
  TGIS_GridToPolygon = class( TGIS_GridToVectorAbstract )
// C++ Builder
class PASCALIMPLEMENTATION TGIS_GridToPolygon : public TGIS_GridToVectorAbstract



Inherited Overrides Protected
Name Visibility Description
Create public


Inherited Overrides Protected
Name Visibility Description
Generate public Creates vector shapes from a grid layer.
(Overrides TGIS_GridToVectorAbstract.Generate)


Inherited Protected
Name Visibility Description
IgnoreNoData public If true (default), cells of NoData is ommitted.
(Inherited from TGIS_GridToVectorAbstract)
SplitShapes public If True (default), single-part polygon shapes are created; otherwise multipart shapes are created.
Tolerance public A minimum distinguishing value of the grid cells.
(Inherited from TGIS_GridToVectorAbstract)


This class creates polygon shapes from connected regions of grid cells sharing the same value.

This value is determined taking into account the Tolerance parameter to avoid a problem with distinguishing floating-point cell values. For example, if Tolerance=0.1, then cell values of 0.123 and 0.111 are considered the same because they are both rounded to 0.1. A cell value of 0.211 is rounded to 0.2 and treated as in different region.

The vectorizing functionality was originally designed to use with classified grid layers, but the Tolerance property extends use of this function to all grid layers, e.g., digital elevation model (DEM) and other grids with continuous data.

Cell values extracted from a grid layer are used to create attribute information for the resultant vector layer.

The following figures illustrates how the input land cover grid data layer is converted to a polygon vector layer.

Land cover grid layer (input) Created vector layer (output)

Data source: © European Union, Copernicus Land Monitoring Service 2018, European Environment Agency (EEA)



  // assume we have a grid layer 'lp'
  // and a vector layer 'lv' with added attribute field 'value'
  // create an instance of TGIS_GridToPolygon class
  polygonizer = TGIS_GridToPolygon.Create;
  // run algorithm
  polygonizer.Generate(lp, lv, 'value');


2021/12/07 08:49

Page Tools