Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder contains all the needed context when generating pbf file.
func NewEncoder ¶
func NewEncoder(input *NewEncoderRequiredInput, opts ...Option) *Encoder
NewEncoder initializes an OSM pbf encoder.
func (*Encoder) AppendNodes ¶
AppendNodes will append nodes to the buffer, when it meets the limit(8000 entities or 32MB) it will convert the nodes to dense nodes and write to the writer.
func (*Encoder) AppendRelations ¶
AppendRelations writes the relation data to the buffer.
func (*Encoder) AppendWays ¶
AppendWays writes OSM way data to buffer.
func (*Encoder) Flush ¶
func (e *Encoder) Flush(memberType MemberType)
Flush consume the remaining data from the buffer immediately and writes to the pbf file.
type Member ¶
type Member struct { ID int64 Type MemberType Role string }
Member is used to describe the entity in one relation.
type MemberType ¶
type MemberType int
MemberType enum
const ( // NodeType ... NodeType MemberType = iota // WayType ... WayType // RelationType ... RelationType )
type NewEncoderRequiredInput ¶
type NewEncoderRequiredInput struct { RequiredFeatures []string Writer io.WriteCloser }
NewEncoderRequiredInput contains the required parameters to initialize an encoder
type Option ¶
type Option func(e *Encoder)
Option type provides different options when initializing the encoder.
func WithBbox ¶
func WithBbox(b *gosmpb.HeaderBBox) Option
WithBbox provides the pbf bbox information in the header block, just an information, does not limit the writing if the data is out of the bbox.
func WithOptionalFeatures ¶
WithOptionalFeatures sets optional features for the encoder
func WithWritingProgram ¶
WithWritingProgram sets the writing program, does not impact the encoding behaviour.
func WithZlipEnabled ¶
WithZlipEnabled enabled zlib when writing data to pbf file.