Class TShapefileGeometryReader

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TShapefileGeometryReader = class(TObject)

Description

TShapefileGeometryReader provides a method of reading the geometry part of ESRI Shapefiles. Each shape in the Shapefile is stored in a TShapeObject which can be accessed through the Items property.

Hierarchy

Overview

Fields

Private FFileHeader: TShapefileHeader;
Private FShapeObjects: TList;
Private FOnProgress: TProgressProcedure;

Methods

Private function GetCount: integer;
Private function GetItems(const Index: integer): TShapeObject;
Public constructor Create;
Public destructor Destroy; override;
Public procedure ReadFromFile(const MainFileName, IndexFileName: string);

Properties

Public property Count: integer read GetCount;
Public property FileHeader: TShapefileHeader read FFileHeader;
Public property Items[constIndex:integer]: TShapeObject read GetItems;
Public property OnProgress: TProgressProcedure read FOnProgress write FOnProgress;

Description

Fields

Private FFileHeader: TShapefileHeader;

See FileHeader.

Private FShapeObjects: TList;

FShapeObjects stores the TShapeObjects accessed through Items. FShapeObjects is instantiated as a TObjectList.

Private FOnProgress: TProgressProcedure;

See OnProgress.

Methods

Private function GetCount: integer;

See Count.

Private function GetItems(const Index: integer): TShapeObject;

See Items.

Public constructor Create;

Create creates an instance of TShapefileGeometryReader.

Public destructor Destroy; override;

Destroy destroys the current instance of TShapefileGeometryReader. Do not call Destroy directly. Call Free instead.

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

ReadFromFile reads the geometry from a file named FileName.

Parameters
MainFileName
is the name of the main geometry file. It has the extension .shp.
IndexFileName
is the name of the index file. It has the extension .shx.
See also
OnProgress
OnProgress is called each time a shape is read from the disk during ReadFromFile.

Properties

Public property Count: integer read GetCount;

Count is the number of TShapeObjects that have been read. See ReadFromFile.

Public property FileHeader: TShapefileHeader read FFileHeader;

FileHeader is the TShapefileHeader at the beginning of the file. The most useful thing about FileHeader is ShapeType which should be one of:

stNull = 0;

stPoint = 1;

stPolyLine = 3;

stPolygon = 5;

stMultiPoint = 8;

stPointZ = 11;

stPolyLineZ = 13;

stPolygonZ = 15;

stMultiPointZ = 18;

stPointM = 21;

stPolyLineM = 23;

stPolygonM = 25;

stMultipointM = 28;

stMultiPatch = 31;

Public property Items[constIndex:integer]: TShapeObject read GetItems;

Items provides access to the TShapeObjects read from the Shapefile with ReadFromFile.

Public property OnProgress: TProgressProcedure read FOnProgress write FOnProgress;

OnProgress is called each time a shape is read from the disk during ReadFromFile. FractionDone will be the fraction of the file that has been read.


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