geojson

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Name = CoordinateReferenceSystemType{/* contains filtered or unexported fields */}
	Link = CoordinateReferenceSystemType{/* contains filtered or unexported fields */}
)
View Source
var (
	GeoTypeInvalid            = NewGeoJsonObjectType("Invalid")
	GeoTypeGeometryCollection = NewGeoJsonObjectType("GeometryCollection")
	GeoTypeLineString         = NewGeoJsonObjectType("LineString")
	GeoTypeMultiLineString    = NewGeoJsonObjectType("MultiLineString")
	GeoTypeMultiPoint         = NewGeoJsonObjectType("MultiPoint")
	GeoTypeMultiPolygon       = NewGeoJsonObjectType("MultiPolygon")
	GeoTypePoint              = NewGeoJsonObjectType("Point")
	GeoTypePolygon            = NewGeoJsonObjectType("Polygon")
)
View Source
var (
	EmptyDoc              = bsonx.Empty()
	DefaultGeoNearOptions = GeoNearConstructibleBson{}.of(EmptyDoc)
)
View Source
var (
	Epsg4326              = NewNamedCoordinateReferenceSystem("EPSG:4326")
	Crs84                 = NewNamedCoordinateReferenceSystem("urn:ogc:def:crs:OGC:1.3:CRS84")
	Epsg4326StrictWinding = NewNamedCoordinateReferenceSystem("urn:x-mongodb:crs:strictwinding:EPSG:4326")
)

Functions

This section is empty.

Types

type CoordinateReferenceSystem

type CoordinateReferenceSystem interface {
	GetType() CoordinateReferenceSystemType
}

type CoordinateReferenceSystemType

type CoordinateReferenceSystemType struct {
	// contains filtered or unexported fields
}

func (CoordinateReferenceSystemType) GetType

type GeoJsonObjectType

type GeoJsonObjectType struct {
	// contains filtered or unexported fields
}

func NewGeoJsonObjectType

func NewGeoJsonObjectType(typeName string) GeoJsonObjectType

func (GeoJsonObjectType) GetType

func (t GeoJsonObjectType) GetType() string

type GeoNearConstructibleBson

type GeoNearConstructibleBson struct {
	// contains filtered or unexported fields
}

func NewGeoNearConstructibleBson

func NewGeoNearConstructibleBson(base bsonx.Bson, appended *bsonx.Document) GeoNearConstructibleBson

func (GeoNearConstructibleBson) BsonDocument

func (a GeoNearConstructibleBson) BsonDocument() *bsonx.BsonDocument

func (GeoNearConstructibleBson) DistanceMultiplier

func (a GeoNearConstructibleBson) DistanceMultiplier(distanceMultiplier int64) GeoNearOptions

func (GeoNearConstructibleBson) Document

func (a GeoNearConstructibleBson) Document() bson.D

func (GeoNearConstructibleBson) IncludeLocs

func (a GeoNearConstructibleBson) IncludeLocs(includeLocs string) GeoNearOptions

func (GeoNearConstructibleBson) Key

func (GeoNearConstructibleBson) MaxDistance

func (a GeoNearConstructibleBson) MaxDistance(maxDistance int64) GeoNearOptions

func (GeoNearConstructibleBson) MinDistance

func (a GeoNearConstructibleBson) MinDistance(minDistance int64) GeoNearOptions

func (GeoNearConstructibleBson) Query

func (GeoNearConstructibleBson) Spherical

type GeoNearOptions

type GeoNearOptions interface {
	bsonx.Bson
	DistanceMultiplier(distanceMultiplier int64) GeoNearOptions
	IncludeLocs(includeLocs string) GeoNearOptions
	Key(key string) GeoNearOptions
	MinDistance(minDistance int64) GeoNearOptions
	MaxDistance(maxDistance int64) GeoNearOptions
	Query(query bsonx.Document) GeoNearOptions
	Spherical() GeoNearOptions
}

type Geometry

type Geometry struct {
	// contains filtered or unexported fields
}

func NewGeometry

func NewGeometry(coordinateReferenceSystem CoordinateReferenceSystem) Geometry

func (Geometry) Encode

func (g Geometry) Encode() *bsonx.BsonDocument

func (Geometry) GetCoordinateReferenceSystem

func (g Geometry) GetCoordinateReferenceSystem() CoordinateReferenceSystem

func (Geometry) GetType

func (g Geometry) GetType() GeoJsonObjectType

type GeometryCollection

type GeometryCollection struct {
	Geometry
	// contains filtered or unexported fields
}

func NewGeometryCollection

func NewGeometryCollection(geometries []Geometry) GeometryCollection

func (GeometryCollection) Encode

func (GeometryCollection) GetCoordinateReferenceSystem

func (p GeometryCollection) GetCoordinateReferenceSystem() CoordinateReferenceSystem

func (GeometryCollection) GetGeometries

func (p GeometryCollection) GetGeometries() []Geometry

func (GeometryCollection) GetType

type IGeometry

type IGeometry interface {
	GetType() GeoJsonObjectType
	GetCoordinateReferenceSystem() CoordinateReferenceSystem
	Encode() *bsonx.BsonDocument
}

type LineString

type LineString struct {
	Geometry
	// contains filtered or unexported fields
}

func NewLineString

func NewLineString(coordinates []Position) LineString

func (LineString) Encode

func (p LineString) Encode() *bsonx.BsonDocument

func (LineString) GetCoordinateReferenceSystem

func (p LineString) GetCoordinateReferenceSystem() CoordinateReferenceSystem

func (LineString) GetCoordinates

func (p LineString) GetCoordinates() []Position

func (LineString) GetType

func (p LineString) GetType() GeoJsonObjectType

type MultiLineString

type MultiLineString struct {
	Geometry
	// contains filtered or unexported fields
}

func NewMultiLineString

func NewMultiLineString(coordinates [][]Position) MultiLineString

func (MultiLineString) Encode

func (p MultiLineString) Encode() *bsonx.BsonDocument

func (MultiLineString) GetCoordinateReferenceSystem

func (p MultiLineString) GetCoordinateReferenceSystem() CoordinateReferenceSystem

func (MultiLineString) GetType

func (p MultiLineString) GetType() GeoJsonObjectType

type MultiPoint

type MultiPoint struct {
	Geometry
	// contains filtered or unexported fields
}

func NewMultiPoint

func NewMultiPoint(coordinates []Position) MultiPoint

func (MultiPoint) Encode

func (p MultiPoint) Encode() *bsonx.BsonDocument

func (MultiPoint) GetCoordinateReferenceSystem

func (p MultiPoint) GetCoordinateReferenceSystem() CoordinateReferenceSystem

func (MultiPoint) GetType

func (p MultiPoint) GetType() GeoJsonObjectType

type MultiPolygon

type MultiPolygon struct {
	Geometry
	// contains filtered or unexported fields
}

func NewMultiPolygon

func NewMultiPolygon(coordinates []PolygonCoordinates) MultiPolygon

func (MultiPolygon) Encode

func (p MultiPolygon) Encode() *bsonx.BsonDocument

func (MultiPolygon) GetCoordinateReferenceSystem

func (p MultiPolygon) GetCoordinateReferenceSystem() CoordinateReferenceSystem

func (MultiPolygon) GetType

func (p MultiPolygon) GetType() GeoJsonObjectType

type NamedCoordinateReferenceSystem

type NamedCoordinateReferenceSystem struct {
	// contains filtered or unexported fields
}

func NewNamedCoordinateReferenceSystem

func NewNamedCoordinateReferenceSystem(name string) NamedCoordinateReferenceSystem

func (NamedCoordinateReferenceSystem) GetType

type Point

type Point struct {
	Geometry
	// contains filtered or unexported fields
}

func NewPoint

func NewPoint(coordinate Position) Point

func (Point) Encode

func (p Point) Encode() *bsonx.BsonDocument

func (Point) GetCoordinateReferenceSystem

func (p Point) GetCoordinateReferenceSystem() CoordinateReferenceSystem

func (Point) GetType

func (p Point) GetType() GeoJsonObjectType

type Polygon

type Polygon struct {
	Geometry
	// contains filtered or unexported fields
}

func NewPolygon

func NewPolygon(exterior []Position, holes ...[]Position) Polygon

func (Polygon) Encode

func (p Polygon) Encode() *bsonx.BsonDocument

func (Polygon) GetCoordinateReferenceSystem

func (p Polygon) GetCoordinateReferenceSystem() CoordinateReferenceSystem

func (Polygon) GetType

func (p Polygon) GetType() GeoJsonObjectType

type PolygonCoordinates

type PolygonCoordinates struct {
	// contains filtered or unexported fields
}

func NewPolygonCoordinates

func NewPolygonCoordinates(exterior []Position, holes [][]Position) PolygonCoordinates

func (PolygonCoordinates) Encode

func (p PolygonCoordinates) Encode() *bsonx.BsonArray

func (PolygonCoordinates) GetExterior

func (p PolygonCoordinates) GetExterior() []Position

func (PolygonCoordinates) GetHoles

func (p PolygonCoordinates) GetHoles() [][]Position

type Position

type Position struct {
	// contains filtered or unexported fields
}

func NewPosition

func NewPosition(values []float64) Position

func (Position) Encode

func (p Position) Encode() *bsonx.BsonArray

func (Position) GetValues

func (p Position) GetValues() []float64

Jump to

Keyboard shortcuts

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