spatial

package
v0.103.2 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	XDR byte = 0x00 // Big endian
	NDR      = 0x01 // Little endian
)

Byte orders

Variables

This section is empty.

Functions

func EncodeEWKB

func EncodeEWKB(g STGeometry, xdr bool, srid int32) ([]byte, error)

EncodeEWKB encodes a geometry to the "extended well known binary" format.

func EncodeWKB

func EncodeWKB(g STGeometry, xdr bool) ([]byte, error)

EncodeWKB encodes a geometry to the "well known binary" format.

func EncodeWKT

func EncodeWKT(g STGeometry) (string, error)

EncodeWKT encodes a geometry to the "well known text" format.

func NaN

func NaN() float64

NaN returns a 'not-a-number' value.

Types

type Dim

type Dim byte

Dim is the type for dimensions (2d, Z, M, MZ)

const (
	Dim2d Dim = iota // two dimensional
	DimZ             // three dimensional
	DimM             // two dimensional with additinal dimensional information in M as time, road-mile, distance or the like
	DimZM            // three dimensional with additinal dimensional information in M
)

Dimensions

type Point

type Point struct{ X, Y, Z, M float64 }

Point represents whether a 2d, Z, M or ZM dimensional point.

func (Point) String

func (p Point) String() string

type Points

type Points []Point

Points is a collection of 0..n points.

func (Points) String

func (pts Points) String() string

type STGeometry

type STGeometry interface {
	// contains filtered or unexported methods
}

STGeometry is the interface representing a spatial type.

type STGeometryCollection

type STGeometryCollection struct {
	Dim        Dim
	Geometries []STGeometry
}

STGeometryCollection is the spatial type for a geometry collection.

type STLineString

type STLineString struct {
	Dim    Dim
	Points Points
}

STLineString is the spatial type for a linestring.

type STMultiLineString

type STMultiLineString struct {
	Dim         Dim
	LineStrings []STLineString
}

STMultiLineString is the spatial type for a multi line string.

type STMultiPoint

type STMultiPoint struct {
	Dim    Dim
	Points Points
}

STMultiPoint is the spatial type for a multipoint.

type STMultiPolygon

type STMultiPolygon struct {
	Dim      Dim
	Polygons []STPolygon
}

STMultiPolygon is the spatial type for a multi polygon.

type STPoint

type STPoint struct {
	Dim   Dim
	Point *Point
}

STPoint is the spatial type for a point.

type STPolygon

type STPolygon struct {
	Dim   Dim
	Rings []Points
}

STPolygon is the spatial type for a polygon.

Jump to

Keyboard shortcuts

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