geometry

package
v0.40.4 Latest Latest
Warning

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

Go to latest
Published: May 19, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SRIDSize       = 4
	EndianSize     = 1
	TypeSize       = 4
	EWKBHeaderSize = SRIDSize + EndianSize + TypeSize

	PointSize = 16
	CountSize = 4
)
View Source
const (
	PointType      = 1
	LinestringType = 2
	PolygonType    = 3
)

Variables

This section is empty.

Functions

func DeserializeLinestring

func DeserializeLinestring(buf []byte, srid uint32) (l sql.Linestring)

func DeserializePoint

func DeserializePoint(buf []byte, srid uint32) (p sql.Point)

func DeserializePolygon

func DeserializePolygon(srid uint32, buf []byte) (p sql.Polygon)

func ParseEWKBHeader

func ParseEWKBHeader(buf []byte) (srid uint32, bigEndian bool, typ uint32)

ParseEWKBHeader converts the header potion of a EWKB byte array to srid, endianness, and geometry type

func ParseEWKBPoint

func ParseEWKBPoint(buf []byte) (x, y float64)

func SerializeLinestring

func SerializeLinestring(l sql.Linestring) (buf []byte)

func SerializePoint

func SerializePoint(p sql.Point) (buf []byte)

func SerializePolygon

func SerializePolygon(p sql.Polygon) (buf []byte)

func WriteEWKBHeader

func WriteEWKBHeader(buf []byte, srid, typ uint32)

func WriteEWKBPointData

func WriteEWKBPointData(buf []byte, x, y float64)

Types

This section is empty.

Jump to

Keyboard shortcuts

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