wkt

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2020 License: BSD-2-Clause Imports: 6 Imported by: 29

Documentation

Overview

Package wkt implements Well Known Text encoding and decoding.

Index

Constants

This section is empty.

Variables

View Source
var ErrBraceMismatch = errors.New("wkt: brace mismatch")

ErrBraceMismatch is returned when braces do not match.

Functions

func Marshal

func Marshal(g geom.T, applyOptFns ...EncodeOption) (string, error)

Marshal translates a geometry to the corresponding WKT.

func Unmarshal added in v1.1.0

func Unmarshal(wkt string) (geom.T, error)

Unmarshal translates a WKT to the corresponding geometry.

Types

type EncodeOption added in v1.2.0

type EncodeOption func(*Encoder)

EncodeOptions specify options to apply to the encoder.

func EncodeOptionWithMaxDecimalDigits added in v1.2.0

func EncodeOptionWithMaxDecimalDigits(maxDecimalDigits int) EncodeOption

EncodeWithMaxDecimalDigits sets the maximum decimal digits to encode.

type Encoder added in v1.2.0

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

Encoder encodes WKT based on specified parameters.

func NewEncoder added in v1.2.0

func NewEncoder(applyOptFns ...EncodeOption) *Encoder

NewEncoder returns a new encoder with the given options set.

func (*Encoder) Encode added in v1.2.0

func (e *Encoder) Encode(g geom.T) (string, error)

Encode translates a geometry to the corresponding WKT.

Jump to

Keyboard shortcuts

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