encode

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GeometryPoint           = "Point"
	GeometryMultiPoint      = "MultiPoint"
	GeometryLineString      = "LineString"
	GeometryMultiLineString = "MultiLineString"
	GeometryPolygon         = "Polygon"
	GeometryMultiPolygon    = "MultiPolygon"
)
View Source
const GeometryCollection = "GeometryCollection"

Variables

View Source
var ErrEmptyGeometry = errors.New("empty geometry")
View Source
var ErrGeometryCollectionUnsupported = errors.New("geometry collection not supported")
View Source
var ErrUnsupportInputType = errors.New("unsupported input type")

Functions

func AnalyzeKeys

func AnalyzeKeys(obj interface{}, opts *EncodingConfig)

func AnalyzePrecision

func AnalyzePrecision(obj interface{}, opts *EncodingConfig)

func EncodeFeature

func EncodeFeature(feature *geojson.Feature, opts *EncodingConfig) (*geobufpb.Data_Feature, error)

func EncodeFeatureCollection

func EncodeFeatureCollection(collection *geojson.FeatureCollection, opts *EncodingConfig) (*geobufpb.Data_FeatureCollection, error)

func EncodeGeometry

func EncodeGeometry(g orb.Geometry, opt *EncodingConfig) (*geobufpb.Data_Geometry, error)

func EncodeId

func EncodeId(id interface{}) (*geobufpb.Data_Feature_Id, error)

func EncodeIntId

func EncodeIntId(id interface{}) (*geobufpb.Data_Feature_IntId, error)

func EncodeValue

func EncodeValue(val interface{}) (*geobufpb.Data_Value, error)

func NewKeyStore

func NewKeyStore() *keyStore

func NewKeyStoreWithKeys

func NewKeyStoreWithKeys(keys []string) *keyStore

Types

type EncodingConfig

type EncodingConfig struct {
	Dimension          uint
	Precision          uint
	HardcodedPrecision bool
	AllowEmptyGeometry bool
	Keys               KeyStore
}

type KeyStore

type KeyStore interface {
	Keys() []string
	IndexOf(key string) int
	Add(key string) int
	Reset()
}

Jump to

Keyboard shortcuts

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