structs.go 679 B

1234567891011121314151617181920212223242526272829303132333435
  1. // SPDX-FileCopyrightText: Adam Evyčędo
  2. //
  3. // SPDX-License-Identifier: AGPL-3.0-or-later
  4. package api
  5. import "github.com/dhconnelly/rtreego"
  6. type TimedStopStub struct {
  7. // StopStub
  8. Time uint
  9. }
  10. func (s StopV2) Bounds() *rtreego.Rect {
  11. rect, err := rtreego.NewRectFromPoints(
  12. rtreego.Point{s.Position.Lat, s.Position.Lon},
  13. rtreego.Point{s.Position.Lat, s.Position.Lon},
  14. )
  15. if err != nil {
  16. panic(err.Error())
  17. }
  18. return rect
  19. }
  20. func (s StopV3) Bounds() *rtreego.Rect {
  21. rect, err := rtreego.NewRectFromPoints(
  22. rtreego.Point{s.Position.Lat, s.Position.Lon},
  23. rtreego.Point{s.Position.Lat, s.Position.Lon},
  24. )
  25. if err != nil {
  26. panic(err.Error())
  27. }
  28. return rect
  29. }