Documentation ¶
Overview ¶
Package geo provides earth geometry functions and constants.
Copyright (c) 2018 - 2024 PhotoPrism UG. All rights reserved.
This program is free software: you can redistribute it and/or modify it under Version 3 of the GNU Affero General Public License (the "AGPL"): <https://docs.photoprism.app/license/agpl> This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. The AGPL is supplemented by our Trademark and Brand Guidelines, which describe how our Brand Assets may be used: <https://www.photoprism.app/trademark>
Feel free to send an email to hello@photoprism.app if you have questions, want to support our work, or just want to say hello.
Additional information can be found in our Developer Guide: <https://docs.photoprism.app/developer-guide/>
Index ¶
- Constants
- func Deg(km float64) float64
- func DegToRad(d float64) float64
- func Km(p, q Position) (km float64)
- func Randomize(value, diameter float64) float64
- type Movement
- func (m *Movement) AverageAltitude() float64
- func (m *Movement) Closest(t time.Time) Position
- func (m *Movement) Deg() (lat, lng float64)
- func (m *Movement) DegLat() float64
- func (m *Movement) DegLng() float64
- func (m *Movement) DegPerSecond() (latSec, lngSec float64)
- func (m *Movement) Duration() time.Duration
- func (m *Movement) EstimateAccuracy(t time.Time) int
- func (m *Movement) EstimateAltitude(t time.Time) float64
- func (m *Movement) EstimateAltitudeInt(t time.Time) int
- func (m *Movement) EstimatePosition(t time.Time) Position
- func (m *Movement) Hours() float64
- func (m *Movement) Km() float64
- func (m *Movement) Meter() float64
- func (m *Movement) Midpoint() Position
- func (m *Movement) Realistic() bool
- func (m *Movement) Seconds() float64
- func (m *Movement) Speed() float64
- func (m *Movement) String() string
- type Position
Constants ¶
const ( DistLimit float64 = 5000 ScopeDistLimit float64 = 50 DefaultDist float64 = 2 )
const (
EarthRadiusKm = 6371 // Earth radius in km
)
const Meter = 0.00001
Variables ¶
This section is empty.
Functions ¶
func Deg ¶
Deg returns the approximate distance in decimal degrees, see https://en.wikipedia.org/wiki/Decimal_degrees.
Types ¶
type Movement ¶
Movement represents a position change in degrees per second.
func NewMovement ¶
NewMovement returns the movement between two positions and points in time.
func (*Movement) AverageAltitude ¶
AverageAltitude returns the average altitude.
func (*Movement) DegPerSecond ¶
DegPerSecond returns the position change in degrees per second.
func (*Movement) EstimateAccuracy ¶
EstimateAccuracy returns the position estimate accuracy in meter.
func (*Movement) EstimateAltitude ¶
EstimateAltitude estimates the altitude at a given time.
func (*Movement) EstimateAltitudeInt ¶
EstimateAltitudeInt returns the estimated altitude as integer.
func (*Movement) EstimatePosition ¶
EstimatePosition returns the estimated position at a given time.
type Position ¶
type Position struct { Name string // Optional name Time time.Time // Optional time Lat float64 // In degree Lng float64 // In degree Altitude float64 // In meter Accuracy int // In meter Estimate bool }
Position represents a geo coordinate.
func (Position) AltitudeInt ¶
AltitudeInt returns the altitude as integer.