Documentation ¶
Index ¶
- Variables
- type Angle
- type Circle
- func (c *Circle) CapBound() s2.Cap
- func (c *Circle) CellUnionBound() []s2.CellID
- func (c *Circle) ContainsCell(cell s2.Cell) bool
- func (c *Circle) ContainsPoint(p s2.Point) bool
- func (c Circle) Equal(c1 Geometry) bool
- func (c *Circle) IntersectsCell(cell s2.Cell) bool
- func (c *Circle) MultiPoint(div int) (lls MultiPoint)
- func (c Circle) NewGeoJSONFeature(property interface{}) *GeoJSONFeature
- func (c Circle) NewGeoJSONGeometry() *GeoJSONGeometry
- func (c Circle) Radius() Km
- func (c Circle) Radiusp() *float64
- func (c *Circle) RectBound() s2.Rect
- func (c Circle) S2Cap() s2.Cap
- func (c *Circle) S2LatLngs(div int) (lls []s2.LatLng)
- func (c *Circle) S2Loop(div int) (loop *s2.Loop)
- func (c Circle) S2Point() s2.Point
- func (c Circle) S2Region() s2.Region
- func (c Circle) String() string
- func (Circle) Type() string
- type GeoJSONFeature
- type GeoJSONFeatureCollection
- type GeoJSONGeometry
- func (geom GeoJSONGeometry) Equal(geom1 GeoJSONGeometry) bool
- func (geom GeoJSONGeometry) Geo() Geometry
- func (geom GeoJSONGeometry) MarshalJSON() ([]byte, error)
- func (geom GeoJSONGeometry) S2LatLng() s2.LatLng
- func (geom GeoJSONGeometry) S2Point() s2.Point
- func (geom GeoJSONGeometry) S2Region() s2.Region
- func (geom GeoJSONGeometry) String() string
- func (geom *GeoJSONGeometry) UnmarshalJSON(data []byte) error
- type Geometry
- type Km
- type LineString
- func (cds *LineString) CapBound() s2.Cap
- func (cds *LineString) CellUnionBound() []s2.CellID
- func (cds *LineString) ContainsCell(c s2.Cell) bool
- func (cds *LineString) ContainsPoint(p s2.Point) bool
- func (cds *LineString) IntersectsCell(c s2.Cell) bool
- func (cds LineString) MapsLatLng() (mlls []maps.LatLng)
- func (cds LineString) MarshalJSON() ([]byte, error)
- func (cds LineString) NewGeoJSONFeature(property interface{}) *GeoJSONFeature
- func (cds LineString) NewGeoJSONGeometry() *GeoJSONGeometry
- func (cds *LineString) Polygon() Polygon
- func (cds LineString) Radiusp() *float64
- func (cds *LineString) RectBound() s2.Rect
- func (cds LineString) S2Loop() *s2.Loop
- func (cds LineString) S2Point() s2.Point
- func (cds LineString) S2Polyline() s2.Polyline
- func (cds LineString) S2Region() s2.Region
- func (LineString) Type() string
- func (cds *LineString) UnmarshalJSON(data []byte) (err error)
- func (cds *LineString) UnmarshalText(b []byte) error
- type MultiPoint
- func (cds MultiPoint) Equal(c1 Geometry) bool
- func (cds MultiPoint) NewGeoJSONFeature(property interface{}) *GeoJSONFeature
- func (cds MultiPoint) NewGeoJSONGeometry() *GeoJSONGeometry
- func (cds MultiPoint) Point() Point
- func (cds MultiPoint) Radiusp() *float64
- func (cds MultiPoint) Reverse() MultiPoint
- func (cds MultiPoint) S2Point() s2.Point
- func (cds MultiPoint) S2Region() s2.Region
- func (cds MultiPoint) String() string
- func (MultiPoint) Type() string
- func (cds *MultiPoint) UnmarshalJSON(str []byte) error
- func (cds *MultiPoint) UnmarshalText(str []byte) error
- type Point
- func (latlong *Point) CityCodeJP() (code string, err error)
- func (ll *Point) CurrentPressure(unit, lang, apikey string) float64
- func (ll *Point) CurrentWeatherData(unit, lang, apikey string) (w *owm.CurrentWeatherData, err error)
- func (latlong Point) DistanceAngle(latlong1 *Point) s1.Angle
- func (latlong Point) DistanceEarthKm(latlong1 *Point) Km
- func (latlong Point) Equal(latlong1 Geometry) bool
- func (latlong Point) Lat() Angle
- func (latlong Point) LatString() (s string)
- func (latlong Point) Lng() Angle
- func (latlong Point) LngString() (s string)
- func (latlong *Point) Locality(ctx context.Context) (s string, err error)
- func (latlong Point) MapsLatLng() maps.LatLng
- func (latlong Point) MarshalJSON() ([]byte, error)
- func (latlong Point) NewGeoJSONFeature(property interface{}) *GeoJSONFeature
- func (latlong Point) NewGeoJSONGeometry() *GeoJSONGeometry
- func (latlong Point) PrecString() (s string)
- func (latlong Point) PrecisionArea() float64
- func (latlong Point) Radiusp() *float64
- func (latlong Point) S2LatLng() s2.LatLng
- func (latlong Point) S2Point() s2.Point
- func (latlong Point) S2Region() s2.Region
- func (latlong Point) SolarAngle(t time.Time) (zenithAngle float64)
- func (latlong Point) String() string
- func (Point) Type() string
- func (latlong *Point) UnmarshalJSON(data []byte) (err error)
- func (latlong *Point) UnmarshalText(iso6709 []byte) error
- type Polygon
- func (cds *Polygon) CapBound() s2.Cap
- func (cds *Polygon) CellUnionBound() []s2.CellID
- func (cds *Polygon) ContainsCell(c s2.Cell) bool
- func (cds *Polygon) ContainsPoint(p s2.Point) bool
- func (cds *Polygon) IntersectsCell(c s2.Cell) bool
- func (cds Polygon) MarshalJSON() ([]byte, error)
- func (cds Polygon) NewGeoJSONFeature(property interface{}) *GeoJSONFeature
- func (cds Polygon) NewGeoJSONGeometry() *GeoJSONGeometry
- func (cds Polygon) Radiusp() *float64
- func (cds *Polygon) RectBound() s2.Rect
- func (cds Polygon) S2Loop() *s2.Loop
- func (cds Polygon) S2Point() s2.Point
- func (cds Polygon) S2Region() s2.Region
- func (Polygon) Type() string
- func (cds *Polygon) UnmarshalJSON(data []byte) (err error)
- type Rect
- func (rect Rect) Center() *Point
- func (rect *Rect) GeoHash() string
- func (rect *Rect) GeoHash5() string
- func (rect *Rect) GeoHash6() string
- func (rect *Rect) GridLocator() string
- func (rect *Rect) MarshalJSON() (bb []byte, e error)
- func (rect Rect) PrecString() (s string)
- func (rect *Rect) S2Rect() s2.Rect
- func (rect *Rect) S2Region() s2.Region
Constants ¶
This section is empty.
Variables ¶
var Config = config{ HTTPClient: http.DefaultClient, Lang: "en", YahooJPAPIURL: "https://map.yahooapis.jp/geoapi/V1/reverseGeoCoder", }
Config is an configuration of environment.
Functions ¶
This section is empty.
Types ¶
type Angle ¶
type Angle struct {
// contains filtered or unexported fields
}
Angle is Angle with precision.
func AngleFromBytes ¶
AngleFromBytes creates Angle from []byte to unmarshal.
func NewAngleFromS1Angle ¶
NewAngleFromS1Angle is constructor for Angle
func (Angle) MarshalJSON ¶
MarshalJSON is a marshaler for JSON.
func (Angle) PrecDegrees ¶
PrecDegrees returns precicion Degree
func (Angle) PrecS1Angle ¶
PrecS1Angle returns precicion s1.Angle
func (*Angle) UnmarshalJSON ¶
UnmarshalJSON is a unmarshaler for JSON.
type Circle ¶
type Circle struct { Point s1.ChordAngle }
Circle is Circle
func NewEmptyCircle ¶
func NewEmptyCircle() *Circle
NewEmptyCircle is constructor for Circle with empty.
func NewPointCircle ¶
NewPointCircle is constructor for Circle with radius = prec
func (*Circle) CellUnionBound ¶
CellUnionBound is for s2.Region interface.
func (*Circle) ContainsCell ¶
ContainsCell is for s2.Region interface.
func (*Circle) ContainsPoint ¶
ContainsPoint is for s2.Region interface.
func (*Circle) IntersectsCell ¶
IntersectsCell is for s2.Region interface.
func (*Circle) MultiPoint ¶
func (c *Circle) MultiPoint(div int) (lls MultiPoint)
MultiPoint is circumference loop by MultiPoint radian is one vertex degree.
func (Circle) NewGeoJSONFeature ¶
func (c Circle) NewGeoJSONFeature(property interface{}) *GeoJSONFeature
NewGeoJSONFeature returns GeoJSONFeature.
func (Circle) NewGeoJSONGeometry ¶
func (c Circle) NewGeoJSONGeometry() *GeoJSONGeometry
NewGeoJSONGeometry returns GeoJSONGeometry.
func (*Circle) S2LatLngs ¶
S2LatLngs is circumference loop by []s2.LatLng. radian is one vertex degree.
type GeoJSONFeature ¶
type GeoJSONFeature struct { Type string `json:"type"` Geometry *GeoJSONGeometry `json:"geometry"` Property interface{} `json:"properties"` }
GeoJSONFeature is Feature of GeoJSON
type GeoJSONFeatureCollection ¶
type GeoJSONFeatureCollection struct { Type string `json:"type"` Features []GeoJSONFeature `json:"features"` }
GeoJSONFeatureCollection is FeatureCollection of GeoJSON
func NewGeoJSONFeatureCollection ¶
func NewGeoJSONFeatureCollection() *GeoJSONFeatureCollection
NewGeoJSONFeatureCollection creates GeoJSONFeatureCollection
func (*GeoJSONFeatureCollection) AddFeature ¶
func (g *GeoJSONFeatureCollection) AddFeature(f GeoJSONFeature) *GeoJSONFeatureCollection
AddFeature adds GeoJSONFeature
type GeoJSONGeometry ¶
type GeoJSONGeometry struct {
// contains filtered or unexported fields
}
GeoJSONGeometry is Geometry of GeoJSON
type GeoJSONGeometry struct { Type string `json:"type"` Coordinates json.RawMessage `json:"coordinates"` Radius *float64 `json:"radius,omitempty"` // only for Circle, which is GeoJSON specification 1.1 and leter. }
func NewGeoJSONGeometry ¶
func NewGeoJSONGeometry(g Geometry) (geom GeoJSONGeometry)
NewGeoJSONGeometry is constructor
func (GeoJSONGeometry) Equal ¶
func (geom GeoJSONGeometry) Equal(geom1 GeoJSONGeometry) bool
Equal return equal or not.
func (GeoJSONGeometry) MarshalJSON ¶
func (geom GeoJSONGeometry) MarshalJSON() ([]byte, error)
MarshalJSON is a marshaler for JSON.
func (GeoJSONGeometry) S2LatLng ¶
func (geom GeoJSONGeometry) S2LatLng() s2.LatLng
S2LatLng returns s2.LatLng
func (GeoJSONGeometry) S2Point ¶
func (geom GeoJSONGeometry) S2Point() s2.Point
S2Point is getter for center of s2.Point.
func (GeoJSONGeometry) S2Region ¶
func (geom GeoJSONGeometry) S2Region() s2.Region
S2Region is getter for s2.Region.
func (GeoJSONGeometry) String ¶
func (geom GeoJSONGeometry) String() string
func (*GeoJSONGeometry) UnmarshalJSON ¶
func (geom *GeoJSONGeometry) UnmarshalJSON(data []byte) error
UnmarshalJSON is a unmarshaler for JSON.
type Geometry ¶
type Geometry interface { Equal(Geometry) bool S2Region() s2.Region S2Point() s2.Point Radiusp() *float64 Type() string String() string }
Geometry is interface for each geometry class @ GeoJSON.
type Km ¶
type Km float64
Km is kilo-meter.
func EarthArcFromAngle ¶
EarthArcFromAngle makes Angle to Distance.
func EarthArcFromChordAngle ¶
func EarthArcFromChordAngle(chordangle s1.ChordAngle) Km
EarthArcFromChordAngle makes ChordAngle to Distance.
func (Km) EarthChordAngle ¶
func (km Km) EarthChordAngle() s1.ChordAngle
EarthChordAngle makes Distance to ChordAngle.
type LineString ¶
type LineString struct {
MultiPoint
}
LineString inherited MultiPoint
func (*LineString) CapBound ¶
func (cds *LineString) CapBound() s2.Cap
CapBound is for s2.Region interface.
func (*LineString) CellUnionBound ¶
func (cds *LineString) CellUnionBound() []s2.CellID
CellUnionBound is for s2.Region interface.
func (*LineString) ContainsCell ¶
func (cds *LineString) ContainsCell(c s2.Cell) bool
ContainsCell is for s2.Region interface.
func (*LineString) ContainsPoint ¶
func (cds *LineString) ContainsPoint(p s2.Point) bool
ContainsPoint is for s2.Region interface.
func (*LineString) IntersectsCell ¶
func (cds *LineString) IntersectsCell(c s2.Cell) bool
IntersectsCell is for s2.Region interface.
func (LineString) MapsLatLng ¶
func (cds LineString) MapsLatLng() (mlls []maps.LatLng)
MapsLatLng convert to google maps.
func (LineString) MarshalJSON ¶
func (cds LineString) MarshalJSON() ([]byte, error)
MarshalJSON is a marshaler for JSON.
func (LineString) NewGeoJSONFeature ¶
func (cds LineString) NewGeoJSONFeature(property interface{}) *GeoJSONFeature
NewGeoJSONFeature returns GeoJSONFeature.
func (LineString) NewGeoJSONGeometry ¶
func (cds LineString) NewGeoJSONGeometry() *GeoJSONGeometry
NewGeoJSONGeometry returns GeoJSONGeometry.
func (*LineString) Polygon ¶
func (cds *LineString) Polygon() Polygon
Polygon make polygon from LineString
func (*LineString) RectBound ¶
func (cds *LineString) RectBound() s2.Rect
RectBound is for s2.Region interface.
func (LineString) S2Polyline ¶
func (cds LineString) S2Polyline() s2.Polyline
S2Polyline is getter for s2.Polyline ([]s2.Point).
func (LineString) S2Region ¶
func (cds LineString) S2Region() s2.Region
S2Region is getter for s2.Polyline ([]s2.Point).
func (*LineString) UnmarshalJSON ¶
func (cds *LineString) UnmarshalJSON(data []byte) (err error)
UnmarshalJSON is a unmarshaler for JSON.
func (*LineString) UnmarshalText ¶
func (cds *LineString) UnmarshalText(b []byte) error
UnmarshalText is from ISO6709 latlongs.
type MultiPoint ¶
type MultiPoint []Point
MultiPoint is slice of *Point
func (MultiPoint) NewGeoJSONFeature ¶
func (cds MultiPoint) NewGeoJSONFeature(property interface{}) *GeoJSONFeature
NewGeoJSONFeature returns GeoJSONFeature.
func (MultiPoint) NewGeoJSONGeometry ¶
func (cds MultiPoint) NewGeoJSONGeometry() *GeoJSONGeometry
NewGeoJSONGeometry returns GeoJSONGeometry.
func (MultiPoint) Reverse ¶
func (cds MultiPoint) Reverse() MultiPoint
Reverse returns reverse order.
func (MultiPoint) String ¶
func (cds MultiPoint) String() string
func (*MultiPoint) UnmarshalJSON ¶
func (cds *MultiPoint) UnmarshalJSON(str []byte) error
UnmarshalJSON is from ISO6709 latlongs.
func (*MultiPoint) UnmarshalText ¶
func (cds *MultiPoint) UnmarshalText(str []byte) error
UnmarshalText is from ISO6709 latlongs.
type Point ¶
type Point struct {
// contains filtered or unexported fields
}
Point is Latitude & Longitude with precision.
func NewPointFromS2Point ¶
NewPointFromS2Point is from s2.Point
func (*Point) CityCodeJP ¶
CityCodeJP return city code. http://www.soumu.go.jp/denshijiti/code.html https://developer.yahoo.co.jp/webapi/map/openlocalplatform/v1/reversegeocoder.html
func (*Point) CurrentPressure ¶
CurrentPressure return a GrndLevel Pressure of the point.
func (*Point) CurrentWeatherData ¶
func (ll *Point) CurrentWeatherData(unit, lang, apikey string) (w *owm.CurrentWeatherData, err error)
CurrentWeatherData return a pointer of struct for CurrentWeatherData
func (Point) DistanceAngle ¶
DistanceAngle in radian.
func (Point) DistanceEarthKm ¶
DistanceEarthKm in km at surface.
func (Point) MapsLatLng ¶
MapsLatLng return maps.LatLng ( "googlemaps.github.io/maps" )
func (Point) MarshalJSON ¶
MarshalJSON is a marshaler for JSON.
func (Point) NewGeoJSONFeature ¶
func (latlong Point) NewGeoJSONFeature(property interface{}) *GeoJSONFeature
NewGeoJSONFeature returns GeoJSONFeature.
func (Point) NewGeoJSONGeometry ¶
func (latlong Point) NewGeoJSONGeometry() *GeoJSONGeometry
NewGeoJSONGeometry returns GeoJSONGeometry.
func (Point) PrecString ¶
PrecString is Precision String()
func (Point) PrecisionArea ¶
PrecisionArea returns area size of precicion.
func (Point) SolarAngle ¶
SolarAngle returns an solar angle at time t.
func (*Point) UnmarshalJSON ¶
UnmarshalJSON is a unmarshaler for JSON.
func (*Point) UnmarshalText ¶
UnmarshalText is from ISO6709 latlongs.
type Polygon ¶
type Polygon struct {
LineString
}
Polygon inherited MultiPoint
func (*Polygon) CellUnionBound ¶
CellUnionBound is for s2.Region interface.
func (*Polygon) ContainsCell ¶
ContainsCell is for s2.Region interface.
func (*Polygon) ContainsPoint ¶
ContainsPoint is for s2.Region interface.
func (*Polygon) IntersectsCell ¶
IntersectsCell is for s2.Region interface.
func (Polygon) MarshalJSON ¶
MarshalJSON is a marshaler for JSON.
func (Polygon) NewGeoJSONFeature ¶
func (cds Polygon) NewGeoJSONFeature(property interface{}) *GeoJSONFeature
NewGeoJSONFeature returns GeoJSONFeature.
func (Polygon) NewGeoJSONGeometry ¶
func (cds Polygon) NewGeoJSONGeometry() *GeoJSONGeometry
NewGeoJSONGeometry returns GeoJSONGeometry.
func (*Polygon) UnmarshalJSON ¶
UnmarshalJSON is a unmarshaler for JSON.
type Rect ¶
Rect is rectangle of latlng.
func NewRectGeoHash ¶
NewRectGeoHash is from GeoHash http://geohash.org/
func NewRectGridLocator ¶
NewRectGridLocator is from Grid Locator. https://en.wikipedia.org/wiki/Maidenhead_Locator_System
func (*Rect) GridLocator ¶
GridLocator is from Grid Locator. https://en.wikipedia.org/wiki/Maidenhead_Locator_System
func (*Rect) MarshalJSON ¶
MarshalJSON is a marshaler for JSON.