Unit ShapefileUnit

DescriptionUsesClasses, Interfaces, Objects and RecordsFunctions and ProceduresTypesConstantsVariables

Description

ShapefileUnit defines TShapefileGeometryReader and TShapefileGeometryWriter which provide methods of reading and writing respectively the geometry part of ESRI Shapefiles. Each shape in the Shapefile is stored in a TShapeObject which can be accessed through the TShapefileGeometryReader.Items and the TShapefileGeometryWriter.Items properties.

See http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf for a description of the Shapefile format.

Uses

Overview

Classes, Interfaces, Objects and Records

Name Description
packed record TBoundingBox TBoundingBox represents the bounding box of a shape or of all the shapes in a Shapefile.
packed record TShapefileHeader TShapefileHeader appears at the beginning of a Shapefile
packed record TShapeRecordHeader TShapeRecordHeader appears at the beginning of each Shape record.
packed record TNullShapeRecord TNullShapeRecord is the constant-length part of a null-shape.
packed record TPointShapeRecord TPointShapeRecord is the constant-length part of a point-shape.
packed record TShapePoint TShapePoint defines a point in a Shapefile.
packed record TMultiPointShapeRecord TMultiPointShapeRecord is the constant-length part of a multi-point shape.
packed record TPolyLineShapeRecord TPolyLineShapeRecord is the constant-length part of a polyline shape.
packed record TPolygonShapeRecord TPolygonShapeRecord is the constant-length part of a polygon shape.
packed record TPointMShapeRecord TPointMShapeRecord is the constant-length part of a PointM shape.
packed record TShapePointM TShapePointM defines a PointM.
packed record TMultiPointMShapeRecord TMultiPointMShapeRecord is the constant-length part of a MultiPointPointM shape.
packed record TPolyLineMShapeRecord TPolyLineMShapeRecord is the constant-length part of a PolyLineM shape.
packed record TPolygonMShapeRecord TPolygonMShapeRecord is the constant-length part of a PolygonM shape.
packed record TPointZShapeRecord TPointZShapeRecord defines a PointZ shape in a Shapefile.
packed record TMultiPointZShapeRecord TMultiPointZShapeRecord is the constant-length part of a MultiPointZ shape.
packed record TPolyLineZShapeRecord TPolyLineZShapeRecord is the constant-length part of a PolyLineZ shape.
packed record TPolygonZShapeRecord TPolygonZShapeRecord is the constant-length part of a PolygonZ shape.
packed record TMultiPatchShapeRecord TMultiPatchShapeRecord defines a MultiPatch shape in a Shapefile.
packed record TShapeIndexRecord TShapeIndexRecord defines a Shape Index record.
Class TShapeObject TShapeObject represents a shape in an ESRI Shapefile. See TShapefileGeometryReader.Items.
Class TShapefileGeometryReader 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.
Class TShapefileGeometryWriter 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.
packed record TDoubleEndianCnvRec TDoubleEndianCnvRec is used in ConvertDouble to convert a double to or from the BigEndian format.
packed record TLongintEndianCnvRec TLongintEndianCnvRec is used in ConvertInteger to convert a longint to or from the BigEndian format.

Functions and Procedures

procedure SwapDoubleBytes(Dest, Source: PDoubleEndianCnvRec);
procedure SwapLongIntBytes(Dest, Source: PLongintEndianCnvRec);
function ConvertDouble(const Value: double): double;
function ConvertInteger(const Value: longint): longint;
function FileShapeType(const FileName: string): integer;

Types

TProgressProcedure = procedure(Sender: TObject; FractionDone: double) of object;
TBytePos = (...);
PDoubleEndianCnvRec = ˆTDoubleEndianCnvRec;
PLongintEndianCnvRec = ˆTLongintEndianCnvRec;

Constants

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;
ptTriangleStrip = 0;
ptTriangleFan = 1;
ptOuterRing = 2;
ptInnerRing = 3;
ptFirstRing = 4;
ptRing = 5;

Description

Functions and Procedures

procedure SwapDoubleBytes(Dest, Source: PDoubleEndianCnvRec);

SwapDoubleBytes copies Bytes in reverse order from Sourceˆ to Destˆ.

SwapDoubleBytes is used in ConvertDouble.

procedure SwapLongIntBytes(Dest, Source: PLongintEndianCnvRec);

SwapLongIntBytes copies Bytes in reverse order from Sourceˆ to Destˆ.

SwapLongIntBytes is used in ConvertInteger.

function ConvertDouble(const Value: double): double;

ConvertDouble converts Value to or from the BigEndian format.

Parameters
Value
is the value to be converted.
Returns

Value after being converted to or from the BigEndian format.

function ConvertInteger(const Value: longint): longint;

ConvertInteger converts Value to or from the BigEndian format.

Parameters
Value
is the value to be converted.
Returns

Value after being converted to or from the BigEndian format.

function FileShapeType(const FileName: string): integer;

FileShapeType reads a TShapefileHeader and returns the type of shape in the file.

The 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;

Types

TProgressProcedure = procedure(Sender: TObject; FractionDone: double) of object;

TProgressProcedure is the type of TShapefileGeometryReader.OnProgress It can be used to show a progress bar to the user while reading a Shapefile.

TBytePos = (...);

enumeration used in variant record

Values
  • bpEndVal:  
  • bpByteVal:  
PDoubleEndianCnvRec = ˆTDoubleEndianCnvRec;

PDoubleEndianCnvRec is a pointer to a TDoubleEndianCnvRec.

PLongintEndianCnvRec = ˆTLongintEndianCnvRec;

PLongintEndianCnvRec is a pointer to a TLongintEndianCnvRec.

Constants

stNull = 0;

Null Shape

stPoint = 1;

Point Shape

stPolyLine = 3;

Polyline Shape

stPolygon = 5;

Polygon Shape

stMultiPoint = 8;

MultiPoint Shape

stPointZ = 11;

PointZ Shape

stPolyLineZ = 13;

PolyLineZ Shape

stPolygonZ = 15;

PolygonZ Shape

stMultiPointZ = 18;

MultiPointZ Shape

stPointM = 21;

PointM Shape

stPolyLineM = 23;

PolyLineM Shape

stPolygonM = 25;

PolygonM Shape

stMultipointM = 28;

MultiPointM Shape

stMultiPatch = 31;

MultiPatch Shape

ptTriangleStrip = 0;

ptTriangleStrip represents a triangle strip. A linked strip of triangles, where every vertex (after the first two) completes a new triangle. A new triangle is always formed by connecting the new vertex with its two immediate predecessors.

ptTriangleFan = 1;

ptTriangleFan represents a triangle fan. A linked fan of triangles, where every vertex (after the first two) completes a new triangle. A new triangle is always formed by connecting the new vertex with its immediate predecessor and the first vertex of the part.

ptOuterRing = 2;

ptOuterRing represents the outer ring of a polygon.

ptInnerRing = 3;

ptInnerRing represents a hole of a polygon.

ptFirstRing = 4;

ptFirstRing represents the first ring of a polygon of an unspecified type.

ptRing = 5;

ptRing represents a ring of a polygon of an unspecified type.


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