package wkt
import "github.com/paulmach/orb/encoding/wkt"
Index ¶
- Variables
- func Marshal(g orb.Geometry) []byte
- func MarshalString(g orb.Geometry) string
- func Unmarshal(s string) (geom orb.Geometry, err error)
- func UnmarshalCollection(s string) (p orb.Collection, err error)
- func UnmarshalLineString(s string) (p orb.LineString, err error)
- func UnmarshalMultiLineString(s string) (p orb.MultiLineString, err error)
- func UnmarshalMultiPoint(s string) (p orb.MultiPoint, err error)
- func UnmarshalMultiPolygon(s string) (p orb.MultiPolygon, err error)
- func UnmarshalPoint(s string) (p orb.Point, err error)
- func UnmarshalPolygon(s string) (p orb.Polygon, err error)
Variables ¶
var ( // ErrNotWKT is returned when unmarshalling WKT and the data is not valid. ErrNotWKT = errors.New("wkt: invalid data") // ErrIncorrectGeometry is returned when unmarshalling WKT data into the wrong type. // For example, unmarshaling linestring data into a point. ErrIncorrectGeometry = errors.New("wkt: incorrect geometry") // ErrUnsupportedGeometry is returned when geometry type is not supported by this lib. ErrUnsupportedGeometry = errors.New("wkt: unsupported geometry") )
Functions ¶
func Marshal ¶
Marshal returns a WKT representation of the geometry.
func MarshalString ¶
MarshalString returns a WKT representation of the geometry as a string.
func Unmarshal ¶
Unmarshal return a geometry by parsing the WKT string.
func UnmarshalCollection ¶
func UnmarshalCollection(s string) (p orb.Collection, err error)
UnmarshalCollection returns the geometry collection represented by the wkt string. Will return ErrIncorrectGeometry if the wkt is not a geometry collection.
func UnmarshalLineString ¶
func UnmarshalLineString(s string) (p orb.LineString, err error)
UnmarshalLineString returns the linestring represented by the wkt string. Will return ErrIncorrectGeometry if the wkt is not a linestring.
func UnmarshalMultiLineString ¶
func UnmarshalMultiLineString(s string) (p orb.MultiLineString, err error)
UnmarshalMultiLineString returns the multi-linestring represented by the wkt string. Will return ErrIncorrectGeometry if the wkt is not a multi-linestring.
func UnmarshalMultiPoint ¶
func UnmarshalMultiPoint(s string) (p orb.MultiPoint, err error)
UnmarshalMultiPoint returns the multi-point represented by the wkt string. Will return ErrIncorrectGeometry if the wkt is not a multi-point.
func UnmarshalMultiPolygon ¶
func UnmarshalMultiPolygon(s string) (p orb.MultiPolygon, err error)
UnmarshalMultiPolygon returns the multi-polygon represented by the wkt string. Will return ErrIncorrectGeometry if the wkt is not a multi-polygon.
func UnmarshalPoint ¶
UnmarshalPoint returns the point represented by the wkt string. Will return ErrIncorrectGeometry if the wkt is not a point.
func UnmarshalPolygon ¶
UnmarshalPolygon returns the polygon represented by the wkt string. Will return ErrIncorrectGeometry if the wkt is not a polygon.
Source Files ¶
- Version
- v0.10.0
- Published
- Jul 16, 2023
- Platform
- js/wasm
- Imports
- 7 packages
- Last checked
- 3 hours ago –
Tools for package owners.