Class: ShapefileRecordPoint

ShapefileRecordPoint(shapefile, buffer)

Contains the data associated with a shapefile point record.

Constructor

new ShapefileRecordPoint(shapefile, buffer)

Constructs a shapefile record for a point. Applications typically do not call this constructor. It is called by Shapefile as shapefile records are read.
Parameters:
Name Type Description
shapefile Shapefile The shapefile containing this record.
buffer ByteBuffer A buffer descriptor to read data from.
Source:
Throws:
If either the specified shapefile or buffer are null or undefined.
Type
ArgumentError

Extends

Members

(readonly) attributes :Object

The attributes associated with this record, as read from the attribute file associated with the shapefile. Empty if there are no attributes associated with this record or with the shapefile.
Type:
  • Object
Inherited From:
Source:

(readonly) boundingRectangle :Array.<Number>

A four-element array containing this record's bounding rectangle, or null if this record has no bounding rectangle. The returned array is ordered as follows: minimum Y, maximum Y, minimum X, maximum X. If the shapefile's coordinate system is geographic then the elements can be interpreted as angular degrees in the order minimum latitude, maximum latitude, minimum longitude, maximum longitude.
Type:
  • Array.<Number>
Inherited From:
Source:

(readonly) firstPartNumber :Number

The first part number in the record.
Type:
  • Number
Inherited From:
Source:

(readonly) lastPartNumber :Number

The last part number in the record.
Type:
  • Number
Inherited From:
Source:

(readonly) mRange :Array.<Number>

The record's M range if the shapefile's shape type is an M type, otherwise null.
Type:
  • Array.<Number>
Inherited From:
Source:

(readonly) mValues :Array.<Number>

The record's M values if the shapefile's shape type is an M type, otherwise null.
Type:
  • Array.<Number>
Inherited From:
Source:

(readonly) numberOfParts :Number

The number of parts in the shapefile.
Type:
  • Number
Inherited From:
Source:

(readonly) numberOfPoints :Number

The number of points in the record.
Type:
  • Number
Inherited From:
Source:

(readonly) recordNumber :Number

This record's ordinal position in the shapefile. 0 indicates the first record in the shapefile.
Type:
  • Number
Inherited From:
Source:

(readonly) shapefile :Shapefile

The shapefile containing this record.
Type:
Inherited From:
Source:

(readonly) zRange :Array.<Number>

The record's Z range if the shapefile's shape type is a Z type, otherwise null.
Type:
  • Array.<Number>
Inherited From:
Source:

(readonly) zValues :Array.<Number>

The record's Z values if the shapefile's shape type is a Z type, otherwise null.
Type:
  • Array.<Number>
Inherited From:
Source:

Methods

isMeasureType() → {Boolean}

Indicate whether the record is of a measure type.
Inherited From:
Source:
Returns:
True if the record is of a measure type.
Type
Boolean

isMultiPointType() → {Boolean}

Indicate whether the record is of a point type.
Inherited From:
Source:
Returns:
True if the record is of a point type.
Type
Boolean

isPointType() → {Boolean}

Indicate whether the record is of a point type.
Inherited From:
Source:
Returns:
True if the record is of a point type.
Type
Boolean

isPolygonType() → {Boolean}

Indicate whether the record is of a polygon type.
Inherited From:
Source:
Returns:
True if the record is of a polygon type.
Type
Boolean

isPolylineType() → {Boolean}

Indicate whether the record is of a polyline type.
Inherited From:
Source:
Returns:
True if the record is of a polyline type.
Type
Boolean

isZType() → {Boolean}

Indicate whether the record is of a depth type.
Inherited From:
Source:
Returns:
True if the record is of a depth type.
Type
Boolean

pointBuffer(partNumber) → {Float64Array}

Returns the points of a specified part of this record.
Parameters:
Name Type Description
partNumber Number The part number of interest. The range of part numbers can be determined via firstPartNumber and lastPartNumber.
Inherited From:
Source:
Returns:
The part's points in the order X0, Y0, X1, Y1, ..., Xn, Yn, where n is the number of points in the part minus one. Returns null if the specified part does not exist.
Type
Float64Array

readHeader()

Reads and parses the contents of a shapefile record from a specified buffer. The buffer's current position must be the start of the record and will be the start of the next record when the method returns.
Inherited From:
Source:

readOptionalMeasures()

Reads any optional measure values from the record buffer.
Inherited From:
Source:

readZ()

Read's the shape's Z values from the record buffer.
Inherited From:
Source:

setAttributes(attributes)

Internal use only. Set the attributes of the record from a dBase file.
Parameters:
Name Type Description
attributes Object Attributes contained in a dBase file.
Inherited From:
Source:

validateShapeType()

Verifies that the record's shape type matches that of the shapefile. All non-null records in a Shapefile must be of the same type. Throws an exception if the types do not match and the shape type is not Shapefile#NULL. Records of type NULL are always valid, and may appear in any Shapefile.

For details, see the ESRI Shapefile specification at , pages 4 and 5.

Inherited From:
Source:
Throws:
Error If the shape types do not match.