User Tools

Site Tools


api:dk11:delphi:gislayervector.tgis_layervector.getshape_tgis_uid_integer



TGIS_LayerVector.GetShape(TGIS_Uid; Integer) method

DK11 for Delphi | GisLayerVector.TGIS_LayerVector.GetShape | Overloads | Constructors | Fields | Methods | Properties | Events

Gets a shape by unique identifier.

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

Syntax

// Delphi
public
  function GetShape(
    const _uid : TGIS_Uid;
    const _cursor : Integer
  ) : TGIS_Shape; overload; virtual;
// C++ Builder
public:
  virtual TGIS_Shape* GetShape(
    TGIS_Uid* const _uid,
    const int _cursor
  ) /* overload */;

Parameters

Name Type Description
_uid TGIS_Uid identifier /same as current record for SHP file/
_cursor Integer cursor allocated by cursorOpen()

Result

Type Description
TGIS_Shape Shape itself or nil.

Remarks

Use this method to get a shape by using its unique id. We can locate a shape by id, change or read its attributes, etc. See example.

When using this operation, never call any function which uses FindFirst..FindNext (any function which iterates through the shapes using it - so never use inside an operation like Locate etc.).

The GetShape returns a weak reference to an internal shape of the current cursor, therefore is not permanent. Another call of GetShape will change this reference. To get a strong reference, call MakeEditable() or CreateCopy() on a shape.

References

2022/11/16 01:22

Page Tools