geo

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2016 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MinCellLevel is the smallest cell level (largest cell size) used by indexing
	MinCellLevel = 5 // Approx 250km x 380km
	// MaxCellLevel is the largest cell leve (smallest cell size) used by indexing
	MaxCellLevel = 16 // Approx 120m x 180m
	// MaxCells is the maximum number of cells to use when indexing regions.
	MaxCells = 18
)
View Source
const EarthRadiusMeters = 1000 * 6371

EarthRadiusMeters is the radius of the earth in meters (in a spherical earth model).

Variables

This section is empty.

Functions

func EarthAngle

func EarthAngle(dist float64) s1.Angle

EarthAngle converts a to distance on earth in meters to an angle

func FilterUids

func FilterUids(uids *task.List, values []*task.Value, q *QueryData) *task.List

FilterUids filters the uids based on the corresponding values and QueryData.

func IndexTokens

func IndexTokens(g *types.Geo) ([]string, error)

IndexTokens returns the tokens to be used in a geospatial index for the given geometry. If the geometry is not supported it returns an error.

func Intersects

func Intersects(l1 *s2.Loop, l2 *s2.Loop) bool

Intersects returns true if the two loops intersect.

func IsGeoFunc

func IsGeoFunc(str string) bool

IsGeoFunc returns if a function is of geo type.

Types

type Area

type Area float64

Area denotes an area on Earth

func EarthArea

func EarthArea(a float64) Area

EarthArea converts an area on the unit sphere to an area on earth in sq. meters.

func (Area) String

func (a Area) String() string

String converts the area to human readable units

type Length

type Length float64

Length denotes a length on Earth

func EarthDistance

func EarthDistance(angle s1.Angle) Length

EarthDistance converts an angle to distance on earth in meters.

func (Length) String

func (l Length) String() string

String converts the length to human readable units

type QueryData

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

QueryData is internal data used by the geo query filter to additionally filter the geometries.

func GetTokens

func GetTokens(funcArgs []string) ([]string, *QueryData, error)

GetTokens returns the corresponding index keys based on the type of function.

func (QueryData) MatchesFilter

func (q QueryData) MatchesFilter(g types.Geo) bool

MatchesFilter applies the query filter to a geo value

type QueryType

type QueryType byte

QueryType indicates the type of geo query.

const (
	// QueryTypeWithin finds all points that are within the given geometry
	QueryTypeWithin QueryType = iota
	// QueryTypeContains finds all polygons that contain the given point
	QueryTypeContains
	// QueryTypeIntersects finds all objects that intersect the given geometry
	QueryTypeIntersects
	// QueryTypeNear finds all points that are within the given distance from the given point.
	QueryTypeNear
)

Jump to

Keyboard shortcuts

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