Documentation ¶
Overview ¶
Package wkt implements Well Known Text encoding and decoding.
Index ¶
Constants ¶
View Source
const ( POINT = 57346 POINTM = 57347 POINTZ = 57348 POINTZM = 57349 LINESTRING = 57350 LINESTRINGM = 57351 LINESTRINGZ = 57352 LINESTRINGZM = 57353 POLYGON = 57354 POLYGONM = 57355 POLYGONZ = 57356 POLYGONZM = 57357 MULTIPOINT = 57358 MULTIPOINTM = 57359 MULTIPOINTZ = 57360 MULTIPOINTZM = 57361 MULTILINESTRING = 57362 MULTILINESTRINGM = 57363 MULTILINESTRINGZ = 57364 MULTILINESTRINGZM = 57365 MULTIPOLYGON = 57366 MULTIPOLYGONM = 57367 MULTIPOLYGONZ = 57368 MULTIPOLYGONZM = 57369 GEOMETRYCOLLECTION = 57370 GEOMETRYCOLLECTIONM = 57371 GEOMETRYCOLLECTIONZ = 57372 GEOMETRYCOLLECTIONZM = 57373 EMPTY = 57374 NUM = 57375 )
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.
Types ¶
type EncodeOption ¶ added in v1.2.0
type EncodeOption func(*Encoder)
An EncodeOption is an encoder option.
func EncodeOptionWithMaxDecimalDigits ¶ added in v1.2.0
func EncodeOptionWithMaxDecimalDigits(maxDecimalDigits int) EncodeOption
EncodeOptionWithMaxDecimalDigits 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.
type SyntaxError ¶ added in v1.4.0
type SyntaxError struct {
// contains filtered or unexported fields
}
SyntaxError is an error that occurs during parsing of a WKT string.
func (*SyntaxError) Error ¶ added in v1.4.0
func (e *SyntaxError) Error() string
Error generates a detailed syntax error message with line and pos numbers as well as a snippet of the erroneous input.
Click to show internal directories.
Click to hide internal directories.