Documentation
¶
Index ¶
- type Reader
- func (r *Reader) Parse() (*model.TYPFile, error)
- func (r *Reader) ReadHeader() (*model.Header, error)
- func (r *Reader) ReadLineTypes(section SectionInfo) ([]model.LineType, error)
- func (r *Reader) ReadPointTypes(section SectionInfo) ([]model.PointType, error)
- func (r *Reader) ReadPolygonTypes(section SectionInfo) ([]model.PolygonType, error)
- func (r *Reader) ReadSectionDirectory(offset int64) ([]Section, error)
- type Section
- type SectionInfo
- type TYPHeader
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader handles parsing of binary TYP files
func (*Reader) ReadHeader ¶
ReadHeader reads and parses the TYP file header Format based on QMapShack implementation
func (*Reader) ReadLineTypes ¶
func (r *Reader) ReadLineTypes(section SectionInfo) ([]model.LineType, error)
ReadLineTypes reads all line type definitions using the index array
func (*Reader) ReadPointTypes ¶
func (r *Reader) ReadPointTypes(section SectionInfo) ([]model.PointType, error)
ReadPointTypes reads all point type definitions using the index array
func (*Reader) ReadPolygonTypes ¶
func (r *Reader) ReadPolygonTypes(section SectionInfo) ([]model.PolygonType, error)
ReadPolygonTypes reads all polygon type definitions using the index array
type Section ¶
type Section struct {
Type byte // Section type (1=points, 2=lines, 3=polygons, etc.)
Offset uint32 // Offset from file start
Length uint32 // Section length in bytes
}
Section represents a section in the TYP file
type SectionInfo ¶
type SectionInfo struct {
DataOffset uint32 // Offset to data section
DataLength uint32 // Length of data section
ArrayOffset uint32 // Offset to index array
ArrayModulo uint16 // Size of each array entry (3, 4, or 5 bytes)
ArraySize uint32 // Total size of array in bytes
}
SectionInfo contains metadata for a TYP section (points, lines, polygons)
type TYPHeader ¶
type TYPHeader struct {
Descriptor uint16 // First field, often equals header length
Version uint16
Year uint16
Month uint8
Day uint8
Hour uint8
Minutes uint8
Seconds uint8
CodePage uint16
PID uint16 // Product ID
FID uint16 // Family ID
// Section information
Points SectionInfo
Polylines SectionInfo
Polygons SectionInfo
Order SectionInfo
}
TYPHeader represents the parsed header with section pointers
Click to show internal directories.
Click to hide internal directories.