spaten

package
v0.0.0-...-85aa7e7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PackFeature

func PackFeature(f spatial.Feature) (fileformat.Feature, error)

PackFeature encapusaltes a spatial feature into an encodable Spaten feature. This is a low level interface and not guaranteed to be stable.

func ReadBlocks

func ReadBlocks(r io.Reader, fs *spatial.FeatureCollection) error

ReadBlocks is a function for reading all features from a file at once.

func UnpackFeature

func UnpackFeature(pf *fileformat.Feature) (spatial.Feature, error)

UnpackFeature unpacks a Spaten feature into a usable spatial feature. This is a low level interface and not guaranteed to be stable.

func WriteBlock

func WriteBlock(w io.Writer, fs []spatial.Feature, meta map[string]interface{}) error

WriteBlock writes a block of spatial data (note that every valid Spaten file needs a file header in front). meta may be nil, if you don't wish to add any block meta.

func WriteFileHeader

func WriteFileHeader(w io.Writer) error

Types

type Chunks

type Chunks struct {
	// contains filtered or unexported fields
}

func (*Chunks) Next

func (c *Chunks) Next() bool

func (*Chunks) Scan

func (c *Chunks) Scan(fc *spatial.FeatureCollection) error

type Codec

type Codec struct {
	// contains filtered or unexported fields
}

func (*Codec) ChunkedDecode

func (c *Codec) ChunkedDecode(r io.Reader) (spatial.Chunks, error)

ChunkedDecode is the preferred method for reading large datasets. It retrieves a file block at a time, making it possible to traverse the file in a streaming manner without allocating enough memory to fit the whole file.

func (*Codec) Close

func (c *Codec) Close(w io.Writer) error

func (*Codec) Decode

func (c *Codec) Decode(r io.Reader, fc *spatial.FeatureCollection) error

func (*Codec) Encode

func (c *Codec) Encode(w io.Writer, fc *spatial.FeatureCollection) error

func (*Codec) EncodeChunk

func (c *Codec) EncodeChunk(w io.Writer, fc *spatial.FeatureCollection) error

EncodeChunk enqueues features to be written out. Call Close when done with the stream.

func (*Codec) Extensions

func (c *Codec) Extensions() []string
type Header struct {
	Version int
}

func ReadFileHeader

func ReadFileHeader(r io.Reader) (Header, error)

Directories

Path Synopsis
Package fileformat is a generated protocol buffer package.
Package fileformat is a generated protocol buffer package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL