DK11 for Delphi | GisLayerVector.TGIS_Shape.Create | Overloads | Constructors | Fields | Methods | Properties
Create a shape instance.
// Delphi public constructor Create( const _dim : TGIS_DimensionType ); overload; virtual;
// C++ Builder Create ( TGIS_DimensionType* const _dim );
Name | Type | Description |
---|---|---|
_dim | TGIS_DimensionType | Dimension |
Use this method to create a shape. Internally it calls Recreate method.
This is a simple procedure showing how to add a shape to the layer.
// some declarations const WKTText='POLYGON((15 15,25 15,25 25,15 25,15 15),(10 10,10 20,20 20,20 10,10 10))'; var layerObj : TGIS_LayerVector ; procedure MyClass.AddShape(); var shp, shp2 : TGIS_Shape; begin // set the original layer form layerObj.RevertAll; // let's create new shapes shp:= TGIS_Shape.Create(nil,nil,false,-1,layerObj); shp2:=TGIS_Shape.Create(nil,nil,false,-1,layerObj); try // make a duplicate shp2.Recreate(shp,nil,false,-1,layerObj); // and try build it from WKT string on the layer layerObj.AddShape( shp.CreateFromWKT(WKTText) ); finally shp.Free; shp2.Free; end; // let's see the results GIS.FullExtent; end;