Versions in this module Expand all Collapse all v1 v1.0.0 Sep 27, 2023 Changes in this version + const DEFAULT_MYSQL_OPEN_STR + const DEFAULT_PGSQL_OPEN_STR + const DEFAULT_TEST_OPEN_STR + const EarthRadius + var GoogleAPIKey = "" + var MapquestAPIKey = "" + var OpenCageAPIKey = "" + func PNPoly(p, a, b *Point) bool + func SetGoogleAPIKey(newAPIKey string) + func SetGoogleGeocodeURL(newGeocodeURL string) + func SetMapquestAPIKey(newAPIKey string) + func SetMapquestGeocodeURL(newGeocodeURL string) + func SetOpenCageAPIKey(newAPIKey string) + func SetOpenCageGeocodeURL(newGeocodeURL string) + type Geocoder interface + Geocode func(query string) (*Point, error) + ReverseGeocode func(p *Point) (string, error) + type GoogleGeocoder struct + HttpClient *http.Client + func (g *GoogleGeocoder) Geocode(address string) (*Point, error) + func (g *GoogleGeocoder) Request(params string) ([]byte, error) + func (g *GoogleGeocoder) ReverseGeocode(p *Point) (string, error) + type MapQuestGeocoder struct + func (g *MapQuestGeocoder) Geocode(address string) (*Point, error) + func (g *MapQuestGeocoder) Request(url string) ([]byte, error) + func (g *MapQuestGeocoder) ReverseGeocode(p *Point) (string, error) + type Mapper interface + PointsWithinRadius func(p *Point, radius int) bool + type OpenCageGeocoder struct + func (g *OpenCageGeocoder) Geocode(address string) (*Point, error) + func (g *OpenCageGeocoder) Request(url string) ([]byte, error) + func (g *OpenCageGeocoder) ReverseGeocode(p *Point) (string, error) + type Point struct + Lat float64 + Lon float64 + func NewPoint(lat, lon float64) *Point + func (p *Point) BearingTo(p2 *Point) float64 + func (p *Point) GreatCircleDistance(p2 *Point) float64 + func (p *Point) MarshalBinary() ([]byte, error) + func (p *Point) MarshalJSON() ([]byte, error) + func (p *Point) MidpointTo(p2 *Point) *Point + func (p *Point) PointAtDistanceAndBearing(dist, bearing float64) *Point + func (p *Point) UnmarshalBinary(data []byte) error + func (p *Point) UnmarshalJSON(data []byte) error + type Polygon struct + func NewPolygon(points []Point) *Polygon + func (p *Polygon) Contains(point *Point) bool + func (p *Polygon) IsClosed() bool + func (p *Polygon) Points() []Point + type SQLConf struct + func GetSQLConf() (*SQLConf, error) + func GetSQLConfFromFile(filename string) (*SQLConf, error) + type SQLMapper struct + func HandleWithSQL() (*SQLMapper, error) + func NewSQLMapper(filename string, conn *sql.DB) (*SQLMapper, error) + func (s *SQLMapper) PointsWithinRadius(p *Point, radius float64) (*sql.Rows, error) + func (s *SQLMapper) SqlDbConn() *sql.DB