User Tools

Site Tools


api:dk11:delphi:gislayervector.tgis_layervector.exportlayer_tgis_layervector_tgis_extent_tgis_shapetype_string_boolean

Table of Contents

TGIS_LayerVector.ExportLayer(TGIS_LayerVector; TGIS_Extent; TGIS_ShapeType; String; Boolean) method

DK for Delphi | GisLayerVector.TGIS_LayerVector.ExportLayer | Overloads | Constructors | Fields | Methods | Properties | Events

Exports the layer.

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

Syntax

// Delphi
public
  procedure ExportLayer(
    const _layer : TGIS_LayerVector;
    const _extent : TGIS_Extent;
    const _type : TGIS_ShapeType;
    const _scope : String;
    const _truncated : Boolean
  ); overload;
// C++ Builder
public:
  void ExportLayer(
    TGIS_LayerVector* const _layer,
    TGIS_Extent* const _extent,
    TGIS_ShapeType* const _type,
    const UnicodeString _scope,
    const bool _truncated
  ) /* overload */;

Parameters

Name Type Description
_layer TGIS_LayerVector layer to be exported to
_extent TGIS_Extent starting extent of layer - can't be zero sized
_type TGIS_ShapeType shape type supported by a layer; if gistypeUnknown is used then export will try to recognize shape on its own;
_scope String SQL query for which shape will be exported
_truncated Boolean if True, then all shapes will be truncated in _extent; if False, only the shape visible in _extent will be exported ;

Remarks

Remember to assign 'path' property to the layer you want to export to, for proper export of the new layer to a file.
Use this method to export a layer. To do this, choose a layer to export to, and use ExportLayer method with proper params. See also the opposite method, ImportLayer.

Example

Here is a simple procedure to export a layer.

Delphi

procedure MyClass.ExportMyLayer();
var
  ll : TGIS_LayerVector ;
  lo : TGIS_LayerVector ;
begin
  // check whether GIS object has any layers
  if GIS.IsEmpty then exit ;
 
  // Get first layer from the viewer
  ll:= TGIS_LayerVector (GIS.Items[0]) ;
 
  // create a layer to which existing layer will be exported
  lo:=TGIS_LayerSHP.Create ;
  try
    lo.Path := 'exported.shp';
    ll.ExportLayer(lo,GisWholeWorld,TGIS_ShapeType.Unknown,'',False);
  finally
    lo.Free;
  end;
end;
2025/01/31 01:08

Page Tools