Class: EsriShapefile::MainFileHeader

Inherits:
Object
  • Object
show all
Includes:
ByteModel
Defined in:
lib/esri_shapefile/models/main_file_header.rb

Overview

The main file header is 100 bytes long. The fields in the file header are listed below with their byte position, type, and byte order. Position is with respect to the start of the file.

Instance Attribute Summary

Attributes included from ByteModel

#metadata

Instance Method Summary collapse

Methods included from ByteModel

extended, included

Instance Method Details

#file_length_bytesObject

The value for file length is the total length of the file in 16-bit words (including the fifty 16-bit words that make up the header). This means that we need to multiply the value by 2 in order to know the size of the file in bytes



37
38
39
# File 'lib/esri_shapefile/models/main_file_header.rb', line 37

def file_length_bytes
  file_length * 2
end

#shapeObject



41
42
43
# File 'lib/esri_shapefile/models/main_file_header.rb', line 41

def shape
  Shapes.from_type(shape_type)
end