User Tools

Site Tools


api:dk11:delphi:gislayervector.tgis_shape.importfromewkt_string

Table of Contents

TGIS_Shape.ImportFromEWKT method

DK for Delphi | GisLayerVector.TGIS_Shape.ImportFromEWKT | Constructors | Fields | Methods | Properties

Import the Extended Well-Known Binary (EWKB) representation of the geometry with SRID meta data into the current shape (see www.postgis.org).

Available also on: .NET | Java | ActiveX | Python.

Syntax

// Delphi
public
  procedure ImportFromEWKT(
    const _ewkt : String
  ); virtual;
// C++ Builder
public:
  virtual void ImportFromEWKT(
    const UnicodeString _ewkt
  );

Parameters

Name Type Description
_ewkt String EWKT text

Remarks

Internally it uses CreateFromEWKT method. If WKT is a different type, the shape will be reset.

Example

Delphi

const
  EWKTText='SRID=4326;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.Shape();
var
  shp : TGIS_Shape ;
begin
  layerObj.RevertAll ;
 
  try
    // create a shape using EWKT string
    shp:=layerObj.CreateShape(TGIS_ShapeType.Polygon);
    shp.ImportFromEWKT( EWKTText ) ;
  except
    ShowMessage( 'Bad format' ) ;
  end ;
 
  GIS.RecalcExtent ;
  GIS.FullExtent ;
  GIS.Invalidate ;
end;
2025/01/31 01:09

Page Tools