DK11 for Delphi | GisLayerVector.TGIS_Shape.CreateFromWKT | Constructors | Fields | Methods | Properties
Create the shape from a Well Known Text (see: www.opengis.org).
// Delphi public function CreateFromWKT( const _wkt : String ) : TGIS_Shape; virtual;
// C++ Builder public: virtual TGIS_Shape* CreateFromWKT( const UnicodeString _wkt );
Name | Type | Description |
---|---|---|
_wkt | String | WKT text |
Type | Description |
---|---|
TGIS_Shape | Newly constructed object or nil. |
var //public declarations layerObj : TGIS_LayerVector ; str : String = 'POLYGON((5 5,25 5,25 25,5 25,5 5),(10 10,10 20,20 20,20 10,10 10))'; procedure MyClass.WKT(); var shp : TGIS_Shape ; begin try layerObj.RevertAll ; shp:=TGIS_Shape.Create(nil,nil,false,0,layerObj); layerObj.AddShape( shp.CreateFromWKT() ) ; shp.Free ; except ShowMessage( 'Bad format' ) ; end ; GIS.RecalcExtent ; GIS.FullExtent ; GIS.Invalidate ; end;