geojson

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Coordinate

type Coordinate struct {
	X float64
	Y float64
}

func C

func C(x, y float64) Coordinate

func LngLat

func LngLat(lng float64, lat float64) Coordinate

func (*Coordinate) ToSlice

func (c *Coordinate) ToSlice() []float64

type GeoCollection

type GeoCollection struct {
	Type string        `bson:"type"`
	Gs   []interface{} `bson:"geometries"`
}

type LineString

type LineString struct {
	Type string      `bson:"type"`
	C    [][]float64 `bson:"coordinates"`
}

func NewLineString

func NewLineString(start, end Coordinate) *LineString

func (*LineString) End

func (l *LineString) End() Coordinate

func (*LineString) Start

func (l *LineString) Start() Coordinate

type MultiLineString

type MultiLineString struct {
	Type string        `bson:"type"`
	C    [][][]float64 `bson:"coordinates"`
}

func NewMLineString

func NewMLineString(lines []*LineString) *MultiLineString

func (*MultiLineString) LineStrings

func (m *MultiLineString) LineStrings() []*LineString

type MultiPoint

type MultiPoint struct {
	Type string      `bson:"type"`
	C    [][]float64 `bson:"coordinates"`
}

func NewMPoint

func NewMPoint(c1 Coordinate, cs ...Coordinate) *MultiPoint

func (*MultiPoint) Coordinates

func (m *MultiPoint) Coordinates() []Coordinate

type MultiPolygon

type MultiPolygon struct {
	Type string          `bson:"type"`
	C    [][][][]float64 `bson:"coordinates"`
}

func NewMPg

func NewMPg(pg1 Polygon, pgs ...Polygon) *MultiPolygon

func (*MultiPolygon) Polygons

func (m *MultiPolygon) Polygons() []*Polygon

type Point

type Point struct {
	Type string    `bson:"type"`
	C    []float64 `bson:"coordinates"`
}

func NewPoint

func NewPoint(c *Coordinate) *Point

func (*Point) Coordinate

func (p *Point) Coordinate() Coordinate

type Polygon

type Polygon struct {
	Type string        `bson:"type"`
	C    [][][]float64 `bson:"coordinates"`
}

func NewPolygon

func NewPolygon(r1 Ring, rs ...Ring) *Polygon

func (*Polygon) Rings

func (p *Polygon) Rings() []*Ring

type Ring

type Ring struct {
	C []Coordinate
}

func R

func R(c1, c2, c3, c4 Coordinate, cn ...Coordinate) *Ring

第一点必须与最后一点一样

Jump to

Keyboard shortcuts

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