Documentation
¶
Overview ¶
Package osmpbf decodes OpenStreetMap (OSM) PBF files. Use this package by creating a NewDecoder and passing it a PBF file. Use Start to start decoding process. Use Decode to return Node, Way and Relation structs.
Index ¶
Constants ¶
const (
// MaxBlobSize is maximum supported blob size.
MaxBlobSize = 32 * 1024 * 1024
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoundingBox ¶
type Pbf ¶
type Pbf struct {
// contains filtered or unexported fields
}
A Pbf reads and decodes OpenStreetMap PBF data from an input stream.
func NewDecoder ¶
NewDecoder returns a new decoder that reads from r.
func (*Pbf) Decode ¶
Decode reads the next object from the input stream and returns either a pointer to Node, Way or Relation struct representing the underlying OpenStreetMap PBF data, or error encountered. The end of the input stream is reported by an io.EOF error.
Decode is safe for parallel execution. Only first error encountered will be returned, subsequent invocations will return io.EOF.
func (*Pbf) SetBufferSize ¶
SetBufferSize sets initial size of decoding buffer. Default value is 1MB, you can set higher value (for example, MaxBlobSize) for (probably) faster decoding, or lower value for reduced memory consumption. Any value will produce valid results; buffer will grow automatically if required.