wkt

package
v1.3.10 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2021 License: BSD-2-Clause Imports: 6 Imported by: 0

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

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

Unmarshal translates a WKT to the corresponding geometry.

Types

type EncodeOption

type EncodeOption func(*Encoder)

EncodeOptions specify options to apply to the encoder.

func EncodeOptionWithMaxDecimalDigits

func EncodeOptionWithMaxDecimalDigits(maxDecimalDigits int) EncodeOption

EncodeWithMaxDecimalDigits sets the maximum decimal digits to encode.

type Encoder

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

Encoder encodes WKT based on specified parameters.

func NewEncoder

func NewEncoder(applyOptFns ...EncodeOption) *Encoder

NewEncoder returns a new encoder with the given options set.

func (*Encoder) Encode

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