wkb

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BigEndian = iota
	LittleEndian
)
View Source
const (
	GeomPoint
	GeomLineString
	GeomPolygon
	GeomMultiPoint
	GeomMultiLineString
	GeomMultiPolygon
	GeomCollection
)
View Source
const (
	ByteOrderSize = int(unsafe.Sizeof(ByteOrder(0)))
	GeomTypeSize  = int(unsafe.Sizeof(Kind(0)))
	HeaderSize    = ByteOrderSize + GeomTypeSize
	CountSize     = int(unsafe.Sizeof(uint32(0)))
	Float64Size   = int(unsafe.Sizeof(float64(0)))
	PointSize     = int(unsafe.Sizeof(Point{}))
)

Variables

View Source
var (
	ErrInvalidStorage   = errors.New("Invalid storage type or size")
	ErrUnsupportedValue = errors.New("Unsupported value")
)

Functions

This section is empty.

Types

type ByteOrder

type ByteOrder byte

type Geometry

type Geometry interface {
	ByteSize() int
	Write(*bytes.Buffer)
}

func New

func New(b []byte) (Geometry, error)

func ReadGeometry

func ReadGeometry(b []byte) ([]byte, Geometry, error)

type GeometryCollection

type GeometryCollection []Geometry

func ReadGeometryCollection

func ReadGeometryCollection(b []byte) ([]byte, GeometryCollection, error)

func (GeometryCollection) ByteSize

func (gc GeometryCollection) ByteSize() int

func (*GeometryCollection) Scan

func (gc *GeometryCollection) Scan(src interface{}) error

func (GeometryCollection) Value

func (gc GeometryCollection) Value() (driver.Value, error)

func (GeometryCollection) Write

func (gc GeometryCollection) Write(buf *bytes.Buffer)

type Kind

type Kind uint32

type LineString

type LineString Points

func ReadLineString

func ReadLineString(b []byte) ([]byte, LineString, error)

func (LineString) ByteSize

func (ls LineString) ByteSize() int

func (*LineString) Scan

func (ls *LineString) Scan(src interface{}) error

func (LineString) Value

func (ls LineString) Value() (driver.Value, error)

func (LineString) Write

func (ls LineString) Write(buf *bytes.Buffer)

type LinearRing

type LinearRing Points

type MultiLineString

type MultiLineString []LineString

func ReadMultiLineString

func ReadMultiLineString(b []byte) ([]byte, MultiLineString, error)

func (MultiLineString) ByteSize

func (mls MultiLineString) ByteSize() int

func (*MultiLineString) Scan

func (mls *MultiLineString) Scan(src interface{}) error

func (MultiLineString) Value

func (mls MultiLineString) Value() (driver.Value, error)

func (MultiLineString) Write

func (mls MultiLineString) Write(buf *bytes.Buffer)

type MultiPoint

type MultiPoint Points

func ReadMultiPoint

func ReadMultiPoint(b []byte) ([]byte, MultiPoint, error)

func (MultiPoint) ByteSize

func (mp MultiPoint) ByteSize() int

func (*MultiPoint) Scan

func (mp *MultiPoint) Scan(src interface{}) error

func (MultiPoint) Value

func (mp MultiPoint) Value() (driver.Value, error)

func (MultiPoint) Write

func (mp MultiPoint) Write(buf *bytes.Buffer)

type MultiPolygon

type MultiPolygon []Polygon

func ReadMultiPolygon

func ReadMultiPolygon(b []byte) ([]byte, MultiPolygon, error)

func (MultiPolygon) ByteSize

func (mp MultiPolygon) ByteSize() int

func (*MultiPolygon) Scan

func (mp *MultiPolygon) Scan(src interface{}) error

func (MultiPolygon) Value

func (mp MultiPolygon) Value() (driver.Value, error)

func (MultiPolygon) Write

func (mp MultiPolygon) Write(buf *bytes.Buffer)

type Point

type Point struct {
	X, Y float64
}

func ReadPoint

func ReadPoint(b []byte) ([]byte, Point, error)

func (Point) ByteSize

func (p Point) ByteSize() int

func (Point) Equal

func (p Point) Equal(other Point) bool

func (*Point) Scan

func (p *Point) Scan(src interface{}) error

func (Point) Value

func (p Point) Value() (driver.Value, error)

func (Point) Write

func (p Point) Write(buf *bytes.Buffer)

type Points

type Points []Point

type Polygon

type Polygon []LinearRing

func ReadPolygon

func ReadPolygon(b []byte) ([]byte, Polygon, error)

func (Polygon) ByteSize

func (p Polygon) ByteSize() int

func (*Polygon) Scan

func (p *Polygon) Scan(src interface{}) error

func (Polygon) Value

func (p Polygon) Value() (driver.Value, error)

func (Polygon) Write

func (p Polygon) Write(buf *bytes.Buffer)

Jump to

Keyboard shortcuts

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