geometry

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Geometry

type Geometry struct {
	*geos.Geom
}

A Geometry is a geometry.

func Must

func Must(g *Geometry, err error) *Geometry

Must panics with err if err is non-nil, otherwise it returns g.

func NewGeometry added in v0.1.0

func NewGeometry(geom *geos.Geom) *Geometry

NewGeometry returns a new Geometry using geom.

func NewGeometryFromGeoJSON

func NewGeometryFromGeoJSON(geoJSON []byte) (*Geometry, error)

NewGeometryFromGeoJSON returns a new Geometry parsed from GeoJSON.

func NewGeometryFromWKB

func NewGeometryFromWKB(wkb []byte) (*Geometry, error)

NewGeometryFromWKB returns a new Geometry from wkb.

func NewGeometryFromWKT

func NewGeometryFromWKT(wkt string) (*Geometry, error)

NewGeometryFromWKT returns a new Geometry from wkt.

func (*Geometry) AsGeoJSON

func (g *Geometry) AsGeoJSON() ([]byte, error)

AsGeoJSON returns the GeoJSON representation of g.

func (*Geometry) Bounds

func (g *Geometry) Bounds() *geos.Box2D

Bounds returns g's bounds.

func (*Geometry) Destroy

func (g *Geometry) Destroy()

Destroy destroys g's geom.

func (*Geometry) GobDecode

func (g *Geometry) GobDecode(data []byte) error

GobDecode implements encoding/gob.GobDecoder.

func (*Geometry) GobEncode

func (g *Geometry) GobEncode() ([]byte, error)

GobEncode implements encoding/gob.GobEncoder.

func (*Geometry) MarshalBinary added in v0.1.0

func (g *Geometry) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (*Geometry) MarshalJSON

func (g *Geometry) MarshalJSON() ([]byte, error)

MarshalJSON implements encoding/json.Marshaler.

func (*Geometry) MarshalText added in v0.1.0

func (g *Geometry) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*Geometry) MarshalXML

func (g *Geometry) MarshalXML(e *xml.Encoder, _ xml.StartElement) error

MarshalXML implements encoding/xml.Marshaler.

func (*Geometry) Scan

func (g *Geometry) Scan(src interface{}) error

Scan implements database/sql.Scanner.

func (*Geometry) SetSRID added in v0.1.0

func (g *Geometry) SetSRID(srid int) *Geometry

SetSRID sets g's SRID.

func (*Geometry) UnmarshalBinary added in v0.1.0

func (g *Geometry) UnmarshalBinary(data []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (*Geometry) UnmarshalJSON

func (g *Geometry) UnmarshalJSON(data []byte) error

UnmarshalJSON implements encoding/json.Unmarshaler.

func (*Geometry) UnmarshalText added in v0.1.0

func (g *Geometry) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (Geometry) Value

func (g Geometry) Value() (driver.Value, error)

Value implements database/sql/driver.Value.

Jump to

Keyboard shortcuts

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