User Tools

Site Tools


TGIS_GridToPolygon class

DK11 for ActiveX | TatukGIS_XDK11.TGIS_GridToPolygon | Classes | Methods | Properties

Class that enables grid to vector (polygon) conversion.

Available also on: Delphi | .NET | Java.


// C#
public class TGIS_GridToPolygon : ITGIS_GridToPolygon, ITGIS_GridToVectorAbstractEvents 
' VisualBasic
Public Class TGIS_GridToPolygon
  Implements ITGIS_GridToPolygon
  Implements ITGIS_GridToVectorAbstractEvents
End Class
// Oxygene
  TGIS_GridToPolygon = public class



Inherited Overrides Protected
Name Visibility Description
AttachDelphiObj public Only for internal use of TatukGIS.
(Inherited from ITBaseObject)
BusyEvent public
(Inherited from ITGIS_GridToVectorAbstractEvents)
DelphiObj public Only for internal use of TatukGIS.
(Inherited from ITBaseObject)
Generate public Creates vector shapes from a grid layer.
(Inherited from ITGIS_GridToVectorAbstract)


Inherited Protected
Name Visibility Description
IgnoreNoData public If true (default), cells of NoData is ommitted.
(Inherited from ITGIS_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 ITGIS_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');


2020/07/29 01:02

Page Tools