Documentation ¶
Index ¶
- Constants
- Variables
- func DistanceInKm(origin, dest Loc) float64
- type Loc
- type Param
- func WithEndTime(t time.Time) Param
- func WithEventID(id int) Param
- func WithFocalMechanismID(id int) Param
- func WithFormat(f string) Param
- func WithIncludeAllMagnitude(i bool) Param
- func WithIncludeAllOrigins(i bool) Param
- func WithIncludeAllStationMagnitudes(i bool) Param
- func WithIncludeArrivals(i bool) Param
- func WithLat(l float64) Param
- func WithLimit(l int) Param
- func WithLon(l float64) Param
- func WithMagnitudeID(id int) Param
- func WithMagnitudeType(m int) Param
- func WithMaxDepth(d float64) Param
- func WithMaxLat(l float64) Param
- func WithMaxLon(l float64) Param
- func WithMaxMag(m float64) Param
- func WithMaxRadius(rad float64) Param
- func WithMaxRadiusKm(rad float64) Param
- func WithMinDepth(d float64) Param
- func WithMinLat(l float64) Param
- func WithMinLon(l float64) Param
- func WithMinMag(m float64) Param
- func WithMinRadius(rad float64) Param
- func WithMinRadiusKm(rad float64) Param
- func WithOffset(o int) Param
- func WithOrderBy(o string) Param
- func WithOriginID(id int) Param
- func WithStartTime(t time.Time) Param
- type QuakeInfo
- type Request
Constants ¶
View Source
const TimeFormat = "2006-01-02T15:04:05.999999"
time format used by the INGV API
Variables ¶
View Source
var TimeLocation = time.UTC
Functions ¶
func DistanceInKm ¶
DistanceInKm computes the distance in KM between two sets of coordinates using the haversine formula, that is, assuming a spherical Earth (the error margin is ~0.3%). This function works around what appears to be a broken min/max radius computation in the API.
Warning: using this function is different than using With{Min,Max}RadiusKm, because the filtering happens after the search, so you have to handle that manually.
Types ¶
type Param ¶
type Param func(r *Request)
func WithEndTime ¶
func WithEventID ¶
func WithFocalMechanismID ¶
func WithFormat ¶
func WithIncludeAllMagnitude ¶
func WithIncludeAllOrigins ¶
func WithIncludeArrivals ¶
func WithMagnitudeID ¶
func WithMagnitudeType ¶
func WithMaxDepth ¶
func WithMaxLat ¶
func WithMaxLon ¶
func WithMaxMag ¶
func WithMaxRadius ¶
func WithMaxRadiusKm ¶
func WithMinDepth ¶
func WithMinLat ¶
func WithMinLon ¶
func WithMinMag ¶
func WithMinRadius ¶
func WithMinRadiusKm ¶
func WithOffset ¶
func WithOrderBy ¶
func WithOriginID ¶
func WithStartTime ¶
type QuakeInfo ¶
type Request ¶
type Request struct { EventID *int `name:"eventid"` OriginID *int `name:"originid"` MagnitudeID *int `name:"magnitudeid"` FocalMechanismID *int `name:"focalmechanismid"` MinLat *float64 `name:"minlat"` MaxLat *float64 `name:"maxlat"` MinLon *float64 `name:"minlon"` MaxLon *float64 `name:"maxlon"` Lat *float64 `name:"lat"` Lon *float64 `name:"lon"` MaxRadius *float64 `name:"maxradius"` MaxRadiusKm *float64 `name:"maxradiuskm"` MinRadius *float64 `name:"minradius"` MinRadiusKm *float64 `name:"minradiuskm"` MinDepth *float64 `name:"mindepth"` MaxDepth *float64 `name:"maxdepth"` StartTime *time.Time `name:"start_time"` EndTime *time.Time `name:"end_time"` MinMag *float64 `name:"minmag"` MaxMag *float64 `name:"maxmag"` MagnitudeType *int `name:"magnitudetype"` Limit *int `name:"limit"` Offset *int `name:"offset"` OrderBy *string `name:"orderby"` IncludeAllMagnitude *bool `name:"includeallmagnitude"` IncludeArrivals *bool `name:"includearrivals"` IncludeAllOrigins *bool `name:"includeallorigins"` IncludeAllStationMagnitudes *bool `name:"includeallstationmagnitudes"` Format *string `name:"format"` }
Click to show internal directories.
Click to hide internal directories.