You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

128 lines
5.2 KiB

  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // source: google/type/latlng.proto
  3. package latlng // import "google.golang.org/genproto/googleapis/type/latlng"
  4. import proto "github.com/golang/protobuf/proto"
  5. import fmt "fmt"
  6. import math "math"
  7. // Reference imports to suppress errors if they are not otherwise used.
  8. var _ = proto.Marshal
  9. var _ = fmt.Errorf
  10. var _ = math.Inf
  11. // This is a compile-time assertion to ensure that this generated file
  12. // is compatible with the proto package it is being compiled against.
  13. // A compilation error at this line likely means your copy of the
  14. // proto package needs to be updated.
  15. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
  16. // An object representing a latitude/longitude pair. This is expressed as a pair
  17. // of doubles representing degrees latitude and degrees longitude. Unless
  18. // specified otherwise, this must conform to the
  19. // <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
  20. // standard</a>. Values must be within normalized ranges.
  21. //
  22. // Example of normalization code in Python:
  23. //
  24. // def NormalizeLongitude(longitude):
  25. // """Wraps decimal degrees longitude to [-180.0, 180.0]."""
  26. // q, r = divmod(longitude, 360.0)
  27. // if r > 180.0 or (r == 180.0 and q <= -1.0):
  28. // return r - 360.0
  29. // return r
  30. //
  31. // def NormalizeLatLng(latitude, longitude):
  32. // """Wraps decimal degrees latitude and longitude to
  33. // [-90.0, 90.0] and [-180.0, 180.0], respectively."""
  34. // r = latitude % 360.0
  35. // if r <= 90.0:
  36. // return r, NormalizeLongitude(longitude)
  37. // elif r >= 270.0:
  38. // return r - 360, NormalizeLongitude(longitude)
  39. // else:
  40. // return 180 - r, NormalizeLongitude(longitude + 180.0)
  41. //
  42. // assert 180.0 == NormalizeLongitude(180.0)
  43. // assert -180.0 == NormalizeLongitude(-180.0)
  44. // assert -179.0 == NormalizeLongitude(181.0)
  45. // assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
  46. // assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
  47. // assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
  48. // assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
  49. // assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
  50. // assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
  51. // assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
  52. // assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
  53. // assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
  54. // assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
  55. type LatLng struct {
  56. // The latitude in degrees. It must be in the range [-90.0, +90.0].
  57. Latitude float64 `protobuf:"fixed64,1,opt,name=latitude,proto3" json:"latitude,omitempty"`
  58. // The longitude in degrees. It must be in the range [-180.0, +180.0].
  59. Longitude float64 `protobuf:"fixed64,2,opt,name=longitude,proto3" json:"longitude,omitempty"`
  60. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  61. XXX_unrecognized []byte `json:"-"`
  62. XXX_sizecache int32 `json:"-"`
  63. }
  64. func (m *LatLng) Reset() { *m = LatLng{} }
  65. func (m *LatLng) String() string { return proto.CompactTextString(m) }
  66. func (*LatLng) ProtoMessage() {}
  67. func (*LatLng) Descriptor() ([]byte, []int) {
  68. return fileDescriptor_latlng_1377c83d03733f23, []int{0}
  69. }
  70. func (m *LatLng) XXX_Unmarshal(b []byte) error {
  71. return xxx_messageInfo_LatLng.Unmarshal(m, b)
  72. }
  73. func (m *LatLng) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  74. return xxx_messageInfo_LatLng.Marshal(b, m, deterministic)
  75. }
  76. func (dst *LatLng) XXX_Merge(src proto.Message) {
  77. xxx_messageInfo_LatLng.Merge(dst, src)
  78. }
  79. func (m *LatLng) XXX_Size() int {
  80. return xxx_messageInfo_LatLng.Size(m)
  81. }
  82. func (m *LatLng) XXX_DiscardUnknown() {
  83. xxx_messageInfo_LatLng.DiscardUnknown(m)
  84. }
  85. var xxx_messageInfo_LatLng proto.InternalMessageInfo
  86. func (m *LatLng) GetLatitude() float64 {
  87. if m != nil {
  88. return m.Latitude
  89. }
  90. return 0
  91. }
  92. func (m *LatLng) GetLongitude() float64 {
  93. if m != nil {
  94. return m.Longitude
  95. }
  96. return 0
  97. }
  98. func init() {
  99. proto.RegisterType((*LatLng)(nil), "google.type.LatLng")
  100. }
  101. func init() { proto.RegisterFile("google/type/latlng.proto", fileDescriptor_latlng_1377c83d03733f23) }
  102. var fileDescriptor_latlng_1377c83d03733f23 = []byte{
  103. // 165 bytes of a gzipped FileDescriptorProto
  104. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x48, 0xcf, 0xcf, 0x4f,
  105. 0xcf, 0x49, 0xd5, 0x2f, 0xa9, 0x2c, 0x48, 0xd5, 0xcf, 0x49, 0x2c, 0xc9, 0xc9, 0x4b, 0xd7, 0x2b,
  106. 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x86, 0xc8, 0xe8, 0x81, 0x64, 0x94, 0x9c, 0xb8, 0xd8, 0x7c,
  107. 0x12, 0x4b, 0x7c, 0xf2, 0xd2, 0x85, 0xa4, 0xb8, 0x38, 0x72, 0x12, 0x4b, 0x32, 0x4b, 0x4a, 0x53,
  108. 0x52, 0x25, 0x18, 0x15, 0x18, 0x35, 0x18, 0x83, 0xe0, 0x7c, 0x21, 0x19, 0x2e, 0xce, 0x9c, 0xfc,
  109. 0xbc, 0x74, 0x88, 0x24, 0x13, 0x58, 0x12, 0x21, 0xe0, 0x94, 0xc0, 0xc5, 0x9f, 0x9c, 0x9f, 0xab,
  110. 0x87, 0x64, 0xac, 0x13, 0x37, 0xc4, 0xd0, 0x00, 0x90, 0x85, 0x01, 0x8c, 0x51, 0x16, 0x50, 0xb9,
  111. 0xf4, 0xfc, 0x9c, 0xc4, 0xbc, 0x74, 0xbd, 0xfc, 0xa2, 0x74, 0xfd, 0xf4, 0xd4, 0x3c, 0xb0, 0x73,
  112. 0xf4, 0x21, 0x52, 0x89, 0x05, 0x99, 0xc5, 0xc8, 0x6e, 0xb5, 0x86, 0x50, 0x8b, 0x98, 0x98, 0xdd,
  113. 0x43, 0x02, 0x92, 0xd8, 0xc0, 0x4a, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x69, 0x12, 0x54,
  114. 0x1c, 0xd5, 0x00, 0x00, 0x00,
  115. }