Documentation ¶
Index ¶
- type Bounds
- type Client
- func (c *Client) AddPoint(pointData *PointData) (r *CommonResp, err error)
- func (c *Client) AddPoints(pointDatas []*PointData) (r *CommonResp, err error)
- func (c *Client) EntityAdd(entityName, entityDesc string) (r *CommonResp, err error)
- func (c *Client) EntityBoundSearch(bounds *Bounds, filter *EntityListFilter, coordType CoordType, ...) (r *EntitiesListResp, err error)
- func (c *Client) EntityDelete(entityName string) (r *CommonResp, err error)
- func (c *Client) EntityList(filter *EntityListFilter, coordType CoordType, pageIndex, pageSize int) (r *EntitiesListResp, err error)
- func (c *Client) EntityRoundSearch(center Point, radius int, filter *EntityListFilter, coordType CoordType, ...) (r *EntitiesListResp, err error)
- func (c *Client) EntitySearch(query string, filter *EntityListFilter, coordType CoordType, ...) (r *EntitiesListResp, err error)
- func (c *Client) EntityUpdate(entityName, entityDesc string) (r *CommonResp, err error)
- func (c *Client) Get(path string, param map[string]string) (body []byte, err error)
- func (c *Client) GetDistance(entityName string, isProcessed bool, startTime, endTime int64, ...) (r *DistanceResp, err error)
- func (serv *Client) GetLatestPoint(entityName string, po *ProcessOption, coordType CoordType) (r *LatestPointResp, err error)
- func (serv *Client) GetTrack(entityName string, isProcessed bool, startTime, endTime int64, ...) (r *GetTrackResp, err error)
- func (c *Client) Post(path string, param map[string]string) (body []byte, err error)
- func (c *Client) SetHttpClient(httpClient *http.Client)
- func (c *Client) StayPoint(entityName string, startTime, endTime, stayTime int64, po *ProcessOption, ...) (r *StayPointResp, err error)
- type CommonResp
- type CoordType
- type Denoise
- type DistanceResp
- type EntitiesListResp
- type EntityListFilter
- type EntityResp
- type GetTrackResp
- type LatestPointResp
- type MapMatch
- type Point
- type PointData
- type PointInfo
- type ProcessOption
- type SimplePointInfo
- type SortType
- type StayPoint
- type StayPointResp
- type SupplementMode
- type Time
- type TransportMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
visit http://lbsyun.baidu.com/apiconsole/key/ 获取ak 如果设置的白名单则设置sk ""
func (*Client) AddPoint ¶
func (c *Client) AddPoint(pointData *PointData) (r *CommonResp, err error)
func (*Client) AddPoints ¶
func (c *Client) AddPoints(pointDatas []*PointData) (r *CommonResp, err error)
func (*Client) EntityAdd ¶
func (c *Client) EntityAdd(entityName, entityDesc string) (r *CommonResp, err error)
func (*Client) EntityBoundSearch ¶
func (c *Client) EntityBoundSearch(bounds *Bounds, filter *EntityListFilter, coordType CoordType, pageIndex, pageSize int) (r *EntitiesListResp, err error)
根据矩形地理范围搜索entity,并返回实时位置
func (*Client) EntityDelete ¶
func (c *Client) EntityDelete(entityName string) (r *CommonResp, err error)
func (*Client) EntityList ¶
func (c *Client) EntityList(filter *EntityListFilter, coordType CoordType, pageIndex, pageSize int) (r *EntitiesListResp, err error)
func (*Client) EntityRoundSearch ¶
func (c *Client) EntityRoundSearch(center Point, radius int, filter *EntityListFilter, coordType CoordType, pageIndex, pageSize int) (r *EntitiesListResp, err error)
func (*Client) EntitySearch ¶
func (c *Client) EntitySearch(query string, filter *EntityListFilter, coordType CoordType, pageIndex, pageSize int) (r *EntitiesListResp, err error)
func (*Client) EntityUpdate ¶
func (c *Client) EntityUpdate(entityName, entityDesc string) (r *CommonResp, err error)
func (*Client) GetDistance ¶
func (c *Client) GetDistance(entityName string, isProcessed bool, startTime, endTime int64, po *ProcessOption, supplementMode SupplementMode) (r *DistanceResp, err error)
func (*Client) GetLatestPoint ¶
func (serv *Client) GetLatestPoint(entityName string, po *ProcessOption, coordType CoordType) (r *LatestPointResp, err error)
func (*Client) GetTrack ¶
func (serv *Client) GetTrack(entityName string, isProcessed bool, startTime, endTime int64, po *ProcessOption, supplementMode SupplementMode, coordType CoordType, sortType SortType, pageIndex, pageSize int) (r *GetTrackResp, err error)
func (*Client) SetHttpClient ¶
SetHttpClient you can set your own http client
func (*Client) StayPoint ¶
func (c *Client) StayPoint(entityName string, startTime, endTime, stayTime int64, po *ProcessOption, coordType CoordType) (r *StayPointResp, err error)
type CommonResp ¶
type DistanceResp ¶
type DistanceResp struct { CommonResp Distance float64 `json:"distance"` }
type EntitiesListResp ¶
type EntitiesListResp struct { CommonResp Total int `json:"total"` Size int64 `json:"size"` Entities []*EntityResp `json:"entities,omitempty"` }
type EntityListFilter ¶
type EntityListFilter struct { EntityNames []string ActiveTime int64 //该时间之后活跃的用户 InactiveTime int64 //该时间之后不活跃的用户 }
func (*EntityListFilter) ToData ¶
func (f *EntityListFilter) ToData() string
type EntityResp ¶
type GetTrackResp ¶
type GetTrackResp struct { CommonResp Total int `json:"total"` Size int64 `json:"size"` Distance float64 `json:"distance"` TollDistance float64 `json:"toll_distance"` StartPoint *SimplePointInfo `json:"start_point,omitempty"` EndPoint *SimplePointInfo `json:"end_point,omitempty"` Points []*PointInfo `json:"points,omitempty"` }
type LatestPointResp ¶
type LatestPointResp struct { CommonResp LatestPoint *PointInfo `json:"latest_point,omitempty"` }
type PointData ¶
type PointData struct { EntityName string `json:"entity_name"` Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` LocTime int64 `json:"loc_time"` CoordType CoordType `json:"coord_type_input"` //坐标类型 wgs84 GPS坐标 | gcj02 国测局加密坐标 | bd09ll 百度经纬度坐标 Speed float64 `json:"speed"` //非必须 Direction int `json:"direction"` // 非必须 0 正北 顺时针 Height float64 `json:"height"` // 非必须 Radius float64 `json:"radius"` //非必须 定位精度,GPS或定位SDK返回的数值 定位精度,GPS或定位SDK返回的值 }
type ProcessOption ¶
type ProcessOption struct { Denoise Denoise MapMatch MapMatch RadiusThreshold int TransportMode TransportMode }
func (*ProcessOption) ToData ¶
func (p *ProcessOption) ToData() string
type SimplePointInfo ¶
type StayPoint ¶
type StayPoint struct { StartTime int64 `json:"start_time"` EndTime int64 `json:"end_time"` StayPoint *SimplePointInfo `json:"stay_point"` }
type StayPointResp ¶
type StayPointResp struct { CommonResp StaypointNum int `json:"staypoint_num"` StayPoints []*StayPoint `json:"stay_points,omitempty"` }
type SupplementMode ¶
type SupplementMode string
const ( NoSupplement SupplementMode = `no_supplement` StraightSupplement SupplementMode = `straight` DrivingSupplement SupplementMode = `driving` RidingSupplement SupplementMode = `riding` WalkingSupplement SupplementMode = `walking` )
type TransportMode ¶
type TransportMode string
const ( DrivingTransportMode TransportMode = `driving` RidingTransportMode TransportMode = `riding` WalkingTransportMode TransportMode = `walking` )
Click to show internal directories.
Click to hide internal directories.