Documentation
¶
Overview ¶
services/track_service.go
Index ¶
- type Edge
- type Graph
- type Item
- type Node
- type PriorityQueue
- type SplitResult
- type TrackService
- func (s *TrackService) CalculateShortestPath(ctx context.Context, linesGeoJSON *geojson.FeatureCollection, ...) (*geojson.FeatureCollection, error)
- func (s *TrackService) FindNearestPointOnLines(ctx context.Context, linesGeoJSON *geojson.FeatureCollection, ...) (snappedPoint []float64, distance float64, lineID int, err error)
- func (s *TrackService) GetAndBreakGeometries(ctx context.Context, layerNames []string, bbox geojson.FeatureCollection) (*geojson.FeatureCollection, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PriorityQueue ¶ added in v1.3.2
type PriorityQueue []*Item
func (PriorityQueue) Len ¶ added in v1.3.2
func (pq PriorityQueue) Len() int
func (PriorityQueue) Less ¶ added in v1.3.2
func (pq PriorityQueue) Less(i, j int) bool
func (*PriorityQueue) Pop ¶ added in v1.3.2
func (pq *PriorityQueue) Pop() interface{}
func (*PriorityQueue) Push ¶ added in v1.3.2
func (pq *PriorityQueue) Push(x interface{})
func (PriorityQueue) Swap ¶ added in v1.3.2
func (pq PriorityQueue) Swap(i, j int)
type SplitResult ¶ added in v1.3.2
type SplitResult struct {
Feature *geojson.Feature
SplitPoint orb.Point
SegmentIndex int // 在哪个线段上打断
T float64 // 投影参数
}
SplitResult 存储线段打断的结果
type TrackService ¶
type TrackService struct{}
func NewTrackService ¶
func NewTrackService() *TrackService
func (*TrackService) CalculateShortestPath ¶
func (s *TrackService) CalculateShortestPath( ctx context.Context, linesGeoJSON *geojson.FeatureCollection, startPoint []float64, endPoint []float64, ) (*geojson.FeatureCollection, error)
func (*TrackService) FindNearestPointOnLines ¶ added in v1.3.2
func (s *TrackService) FindNearestPointOnLines( ctx context.Context, linesGeoJSON *geojson.FeatureCollection, targetPoint []float64, maxDistance float64, ) (snappedPoint []float64, distance float64, lineID int, err error)
FindNearestPointOnLines 修改签名,添加 maxDistance 参数
func (*TrackService) GetAndBreakGeometries ¶
func (s *TrackService) GetAndBreakGeometries( ctx context.Context, layerNames []string, bbox geojson.FeatureCollection, ) (*geojson.FeatureCollection, error)
Click to show internal directories.
Click to hide internal directories.