Class TShapefileGeometryWriter

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TShapefileGeometryWriter = class(TObject)

Description

TShapefileGeometryWriter provides a method of writing the geometry part of ESRI Shapefiles. Each shape in the Shapefile is stored in a TShapeObject which can be added through the AddShape method.

Hierarchy

Overview

Fields

Private FShapeType: longint;
Private FShapes: TList;
Private FOnProgress: TProgressProcedure;

Methods

Private function GetCapacity: integer;
Private function GetCount: integer;
Private function GetItem(Index: integer): TShapeObject;
Private procedure SetCapacity(const Value: integer);
Public Constructor Create(ShapeType: longint; OwnsShapes: boolean);
Public Destructor Destroy; override;
Public procedure AddShape(Shape: TShapeObject);
Public procedure WriteToFile(const MainFileName, IndexFileName: string);

Properties

Public property Capacity: integer read GetCapacity write SetCapacity;
Public property Count: integer read GetCount;
Public property Items[Index:integer]: TShapeObject read GetItem;
Public property OnProgress: TProgressProcedure read FOnProgress write FOnProgress;

Description

Fields

Private FShapeType: longint;

FShapeType indicates the type of TShapeObject that can be stored in TShapefileGeometryWriter.

See also
TShapeObject.FShapeType
FShapeType indicates the type of shape stored in the Shapefile.
Private FShapes: TList;

FShapes stores the TShapeObjects in FShapes.

Private FOnProgress: TProgressProcedure;

See OnProgress.

Methods

Private function GetCapacity: integer;

See Capacity.

Private function GetCount: integer;

See Count.

Private function GetItem(Index: integer): TShapeObject;

See Items.

Private procedure SetCapacity(const Value: integer);

See Capacity.

Public Constructor Create(ShapeType: longint; OwnsShapes: boolean);

Create creates an instance of TShapefileGeometryWriter. ShapeType indicates the type of TShapeObject that can be added to TShapefileGeometryWriter through AddShape. If OwnsShapes is True, any TShapeObjects added to the TShapefileGeometryWriter through AddShape will be destroyed when the TShapefileGeometryWriter is destroyed.

Public Destructor Destroy; override;

Destroy destroys the current instance of TShapefileGeometryWriter. Don't call Destroy. Call Free instead.

Public procedure AddShape(Shape: TShapeObject);

AddShape adds a TShapeObject to those stored in the TShapefileGeometryWriter. The TShapeObject.FShapeType must match the ShapeType in Create.

Public procedure WriteToFile(const MainFileName, IndexFileName: string);

WriteToFile writes the Shapes to a Shapefile and Shape index file. The file names of these to files are passed into the procedure. According to the specification, these to names must be identical except for their extensions (.shp and .shx). WriteToFile does not enforce this or any other restrictions on the file names.

Properties

Public property Capacity: integer read GetCapacity write SetCapacity;

Capacity indicates how many TShapeObjects can be stored in the TShapefileGeometryWriter without needing to reallocate memory.

Public property Count: integer read GetCount;

Count indicates how many TShapeObjects are stored in the TShapefileGeometryWriter.

Public property Items[Index:integer]: TShapeObject read GetItem;

Items provides access to the TShapeObjects stored in the TShapefileGeometryWriter.

Public property OnProgress: TProgressProcedure read FOnProgress write FOnProgress;

OnProgress is called each time a shape is written to the disk during WriteToFile. FractionDone will be the fraction of the shapes that have been written.


Generated by PasDoc 0.12.1 on 2013-05-13 15:42:03