User Tools

Site Tools


api:dk11:delphi:gislayervector.tgis_layervector.importlayer_tgis_layervector_tgis_extent_tgis_shapetype_string_tgis_shape_string_boolean



TGIS_LayerVector.ImportLayer(TGIS_LayerVector; TGIS_Extent; TGIS_ShapeType; String; TGIS_Shape; String; Boolean) method

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

Import shapes with spatial and topological relationship filtering. Selects shapes by extent, SQL (Structured Query Language) query, and DE-9IM (Dimensionally Extended nine-Intersection Model) spatial relationship to a reference geometry.

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

Syntax

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

Parameters

Name Type Description
_layer TGIS_LayerVector Source vector layer from which shapes are imported.
_extent TGIS_Extent Spatial extent for import filtering.
_type TGIS_ShapeType Target shape type. Use TGIS_ShapeType.Unknown to accept any source shape type.
_scope String SQL WHERE clause using source layer field names. Empty string imports all shapes that pass the spatial filters.
_shape TGIS_Shape Reference geometry for the DE-9IM (Dimensionally Extended nine-Intersection Model) topological relationship test. If not assigned, only extent and SQL filters are applied.
_de9im String DE-9IM (Dimensionally Extended nine-Intersection Model) matrix string defining the required spatial relationship.
_truncated Boolean True clips imported geometries to the extent boundary. False imports full geometries without clipping.

Remarks

PURPOSE: Import a subset of shapes from another vector layer using spatial extent, attribute filtering, and optional topological relationship rules.

BEHAVIOR: Delegates to ImportLayerEx using the supplied reference geometry and DE-9IM (Dimensionally Extended nine-Intersection Model) relation string.

USAGE: Import only shapes that satisfy a DE-9IM relation to a reference geometry.

target.Path = 'imported.shp'
target.CS = source.CS
target.ImportLayer(source, source.Extent, Unknown, '',
filter_shape, TGIS_Utils.GIS_RELATE_CONTAINS, False)

CONSTRAINTS: Import behavior is implemented by ImportLayerEx.

Example

Delphi

procedure MyClass.ImportMyLayer();
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 imported
  lo:=TGIS_LayerSHP.Create ;
  try
    lo.Path := 'imported.shp';
    lo.ImportLayer(ll,GisWholeWorld,TGIS_ShapeType.Unknown,'',False);
  finally
    lo.Free;
  end;
end;

References

2026/10/31 23:00

Page Tools