github.com/cockroachdb/cockroachdb-parser@v0.23.3-0.20240213214944-911057d40c9a/pkg/geo/geopb/geopb.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: geo/geopb/geopb.proto 3 4 package geopb 5 6 import ( 7 encoding_binary "encoding/binary" 8 fmt "fmt" 9 _ "github.com/gogo/protobuf/gogoproto" 10 proto "github.com/gogo/protobuf/proto" 11 io "io" 12 math "math" 13 math_bits "math/bits" 14 ) 15 16 // Reference imports to suppress errors if they are not otherwise used. 17 var _ = proto.Marshal 18 var _ = fmt.Errorf 19 var _ = math.Inf 20 21 // This is a compile-time assertion to ensure that this generated file 22 // is compatible with the proto package it is being compiled against. 23 // A compilation error at this line likely means your copy of the 24 // proto package needs to be updated. 25 const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 26 27 // ShapeType is the type of a spatial shape. Each of these corresponds to a 28 // different representation and serialization format. For example, a Point is a 29 // pair of doubles (or more than that for geometries with Z or N), a LineString 30 // is an ordered series of Points, etc. 31 type ShapeType int32 32 33 const ( 34 ShapeType_Unset ShapeType = 0 35 ShapeType_Point ShapeType = 1 36 ShapeType_LineString ShapeType = 2 37 ShapeType_Polygon ShapeType = 3 38 ShapeType_MultiPoint ShapeType = 4 39 ShapeType_MultiLineString ShapeType = 5 40 ShapeType_MultiPolygon ShapeType = 6 41 // Geometry can contain any type. 42 ShapeType_Geometry ShapeType = 7 43 // GeometryCollection can contain a list of any above type except for Geometry. 44 ShapeType_GeometryCollection ShapeType = 8 45 ShapeType_PointM ShapeType = 536870913 46 ShapeType_LineStringM ShapeType = 536870914 47 ShapeType_PolygonM ShapeType = 536870915 48 ShapeType_MultiPointM ShapeType = 536870916 49 ShapeType_MultiLineStringM ShapeType = 536870917 50 ShapeType_MultiPolygonM ShapeType = 536870918 51 ShapeType_GeometryM ShapeType = 536870919 52 ShapeType_GeometryCollectionM ShapeType = 536870920 53 ShapeType_PointZ ShapeType = 1073741825 54 ShapeType_LineStringZ ShapeType = 1073741826 55 ShapeType_PolygonZ ShapeType = 1073741827 56 ShapeType_MultiPointZ ShapeType = 1073741828 57 ShapeType_MultiLineStringZ ShapeType = 1073741829 58 ShapeType_MultiPolygonZ ShapeType = 1073741830 59 ShapeType_GeometryZ ShapeType = 1073741831 60 ShapeType_GeometryCollectionZ ShapeType = 1073741832 61 ShapeType_PointZM ShapeType = 1610612737 62 ShapeType_LineStringZM ShapeType = 1610612738 63 ShapeType_PolygonZM ShapeType = 1610612739 64 ShapeType_MultiPointZM ShapeType = 1610612740 65 ShapeType_MultiLineStringZM ShapeType = 1610612741 66 ShapeType_MultiPolygonZM ShapeType = 1610612742 67 ShapeType_GeometryZM ShapeType = 1610612743 68 ShapeType_GeometryCollectionZM ShapeType = 1610612744 69 ) 70 71 var ShapeType_name = map[int32]string{ 72 0: "Unset", 73 1: "Point", 74 2: "LineString", 75 3: "Polygon", 76 4: "MultiPoint", 77 5: "MultiLineString", 78 6: "MultiPolygon", 79 7: "Geometry", 80 8: "GeometryCollection", 81 536870913: "PointM", 82 536870914: "LineStringM", 83 536870915: "PolygonM", 84 536870916: "MultiPointM", 85 536870917: "MultiLineStringM", 86 536870918: "MultiPolygonM", 87 536870919: "GeometryM", 88 536870920: "GeometryCollectionM", 89 1073741825: "PointZ", 90 1073741826: "LineStringZ", 91 1073741827: "PolygonZ", 92 1073741828: "MultiPointZ", 93 1073741829: "MultiLineStringZ", 94 1073741830: "MultiPolygonZ", 95 1073741831: "GeometryZ", 96 1073741832: "GeometryCollectionZ", 97 1610612737: "PointZM", 98 1610612738: "LineStringZM", 99 1610612739: "PolygonZM", 100 1610612740: "MultiPointZM", 101 1610612741: "MultiLineStringZM", 102 1610612742: "MultiPolygonZM", 103 1610612743: "GeometryZM", 104 1610612744: "GeometryCollectionZM", 105 } 106 107 var ShapeType_value = map[string]int32{ 108 "Unset": 0, 109 "Point": 1, 110 "LineString": 2, 111 "Polygon": 3, 112 "MultiPoint": 4, 113 "MultiLineString": 5, 114 "MultiPolygon": 6, 115 "Geometry": 7, 116 "GeometryCollection": 8, 117 "PointM": 536870913, 118 "LineStringM": 536870914, 119 "PolygonM": 536870915, 120 "MultiPointM": 536870916, 121 "MultiLineStringM": 536870917, 122 "MultiPolygonM": 536870918, 123 "GeometryM": 536870919, 124 "GeometryCollectionM": 536870920, 125 "PointZ": 1073741825, 126 "LineStringZ": 1073741826, 127 "PolygonZ": 1073741827, 128 "MultiPointZ": 1073741828, 129 "MultiLineStringZ": 1073741829, 130 "MultiPolygonZ": 1073741830, 131 "GeometryZ": 1073741831, 132 "GeometryCollectionZ": 1073741832, 133 "PointZM": 1610612737, 134 "LineStringZM": 1610612738, 135 "PolygonZM": 1610612739, 136 "MultiPointZM": 1610612740, 137 "MultiLineStringZM": 1610612741, 138 "MultiPolygonZM": 1610612742, 139 "GeometryZM": 1610612743, 140 "GeometryCollectionZM": 1610612744, 141 } 142 143 func (x ShapeType) String() string { 144 return proto.EnumName(ShapeType_name, int32(x)) 145 } 146 147 func (ShapeType) EnumDescriptor() ([]byte, []int) { 148 return fileDescriptor_e98b4c2fa47407b4, []int{0} 149 } 150 151 // SpatialObjectType represents the type of the SpatialObject. 152 type SpatialObjectType int32 153 154 const ( 155 SpatialObjectType_Unknown SpatialObjectType = 0 156 SpatialObjectType_GeographyType SpatialObjectType = 1 157 SpatialObjectType_GeometryType SpatialObjectType = 2 158 ) 159 160 var SpatialObjectType_name = map[int32]string{ 161 0: "Unknown", 162 1: "GeographyType", 163 2: "GeometryType", 164 } 165 166 var SpatialObjectType_value = map[string]int32{ 167 "Unknown": 0, 168 "GeographyType": 1, 169 "GeometryType": 2, 170 } 171 172 func (x SpatialObjectType) String() string { 173 return proto.EnumName(SpatialObjectType_name, int32(x)) 174 } 175 176 func (SpatialObjectType) EnumDescriptor() ([]byte, []int) { 177 return fileDescriptor_e98b4c2fa47407b4, []int{1} 178 } 179 180 // SpatialObject represents a serialization of a Geospatial type. 181 type SpatialObject struct { 182 // Type is the type of the SpatialObject. 183 Type SpatialObjectType `protobuf:"varint,1,opt,name=type,proto3,enum=cockroach.geopb.SpatialObjectType" json:"type,omitempty"` 184 // EWKB is the EWKB representation of the spatial object. 185 EWKB EWKB `protobuf:"bytes,2,opt,name=ewkb,proto3,casttype=EWKB" json:"ewkb,omitempty"` 186 // SRID is the denormalized SRID derived from the EWKB. 187 SRID SRID `protobuf:"varint,3,opt,name=srid,proto3,casttype=SRID" json:"srid,omitempty"` 188 // ShapeType is denormalized ShapeType derived from the EWKB. 189 ShapeType ShapeType `protobuf:"varint,4,opt,name=shape_type,json=shapeType,proto3,enum=cockroach.geopb.ShapeType" json:"shape_type,omitempty"` 190 // BoundingBox is the bounding box of the SpatialObject. 191 BoundingBox *BoundingBox `protobuf:"bytes,5,opt,name=bounding_box,json=boundingBox,proto3" json:"bounding_box,omitempty"` 192 } 193 194 func (m *SpatialObject) Reset() { *m = SpatialObject{} } 195 func (m *SpatialObject) String() string { return proto.CompactTextString(m) } 196 func (*SpatialObject) ProtoMessage() {} 197 func (*SpatialObject) Descriptor() ([]byte, []int) { 198 return fileDescriptor_e98b4c2fa47407b4, []int{0} 199 } 200 func (m *SpatialObject) XXX_Unmarshal(b []byte) error { 201 return m.Unmarshal(b) 202 } 203 func (m *SpatialObject) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 204 b = b[:cap(b)] 205 n, err := m.MarshalToSizedBuffer(b) 206 if err != nil { 207 return nil, err 208 } 209 return b[:n], nil 210 } 211 func (m *SpatialObject) XXX_Merge(src proto.Message) { 212 xxx_messageInfo_SpatialObject.Merge(m, src) 213 } 214 func (m *SpatialObject) XXX_Size() int { 215 return m.Size() 216 } 217 func (m *SpatialObject) XXX_DiscardUnknown() { 218 xxx_messageInfo_SpatialObject.DiscardUnknown(m) 219 } 220 221 var xxx_messageInfo_SpatialObject proto.InternalMessageInfo 222 223 // BoundingBox represents the bounding box of a Geospatial type. 224 // Note the lo coordinates can be higher in value than the hi coordinates 225 // for spherical geometries. 226 // NOTE: Do not use these to compare bounding boxes. Use the library functions 227 // provided in the geo package to perform these calculations. 228 type BoundingBox struct { 229 LoX float64 `protobuf:"fixed64,1,opt,name=lo_x,json=loX,proto3" json:"lo_x,omitempty"` 230 HiX float64 `protobuf:"fixed64,2,opt,name=hi_x,json=hiX,proto3" json:"hi_x,omitempty"` 231 LoY float64 `protobuf:"fixed64,3,opt,name=lo_y,json=loY,proto3" json:"lo_y,omitempty"` 232 HiY float64 `protobuf:"fixed64,4,opt,name=hi_y,json=hiY,proto3" json:"hi_y,omitempty"` 233 } 234 235 func (m *BoundingBox) Reset() { *m = BoundingBox{} } 236 func (m *BoundingBox) String() string { return proto.CompactTextString(m) } 237 func (*BoundingBox) ProtoMessage() {} 238 func (*BoundingBox) Descriptor() ([]byte, []int) { 239 return fileDescriptor_e98b4c2fa47407b4, []int{1} 240 } 241 func (m *BoundingBox) XXX_Unmarshal(b []byte) error { 242 return m.Unmarshal(b) 243 } 244 func (m *BoundingBox) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 245 b = b[:cap(b)] 246 n, err := m.MarshalToSizedBuffer(b) 247 if err != nil { 248 return nil, err 249 } 250 return b[:n], nil 251 } 252 func (m *BoundingBox) XXX_Merge(src proto.Message) { 253 xxx_messageInfo_BoundingBox.Merge(m, src) 254 } 255 func (m *BoundingBox) XXX_Size() int { 256 return m.Size() 257 } 258 func (m *BoundingBox) XXX_DiscardUnknown() { 259 xxx_messageInfo_BoundingBox.DiscardUnknown(m) 260 } 261 262 var xxx_messageInfo_BoundingBox proto.InternalMessageInfo 263 264 func init() { 265 proto.RegisterEnum("cockroach.parser.geopb.ShapeType", ShapeType_name, ShapeType_value) 266 proto.RegisterEnum("cockroach.parser.geopb.SpatialObjectType", SpatialObjectType_name, SpatialObjectType_value) 267 proto.RegisterType((*SpatialObject)(nil), "cockroach.parser.geopb.SpatialObject") 268 proto.RegisterType((*BoundingBox)(nil), "cockroach.parser.geopb.BoundingBox") 269 } 270 271 func init() { proto.RegisterFile("geo/geopb/geopb.proto", fileDescriptor_e98b4c2fa47407b4) } 272 273 var fileDescriptor_e98b4c2fa47407b4 = []byte{ 274 // 676 bytes of a gzipped FileDescriptorProto 275 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x94, 0x4d, 0x6f, 0xda, 0x40, 276 0x10, 0x86, 0x31, 0x2c, 0x0e, 0x0c, 0x84, 0x2c, 0x9b, 0x0f, 0xd1, 0x34, 0x72, 0x11, 0xea, 0x01, 277 0xe5, 0x00, 0x52, 0x2a, 0x55, 0xea, 0xa9, 0x12, 0x6d, 0x14, 0x55, 0xad, 0xd5, 0xc8, 0x69, 0xd4, 278 0xc4, 0x17, 0x84, 0x89, 0x65, 0x5c, 0x1c, 0xaf, 0x05, 0x8e, 0x82, 0x6f, 0xf4, 0xbb, 0xb7, 0xf6, 279 0x57, 0x55, 0x39, 0xe6, 0x98, 0x53, 0xd5, 0x92, 0x7f, 0x91, 0x53, 0xe5, 0x59, 0x1b, 0x0c, 0xe4, 280 0x62, 0xef, 0xcc, 0xbc, 0x3b, 0xf3, 0xf8, 0x65, 0x59, 0xd8, 0xb4, 0x4c, 0xde, 0xb4, 0x4c, 0xee, 281 0x19, 0xe2, 0xd9, 0xf0, 0x06, 0xdc, 0xe7, 0x6c, 0xad, 0xcb, 0xbb, 0xfd, 0x01, 0xef, 0x74, 0x7b, 282 0x0d, 0x4c, 0x6f, 0x6f, 0x58, 0xdc, 0xe2, 0x58, 0x6b, 0x86, 0x2b, 0x21, 0xab, 0xfd, 0x4c, 0xc3, 283 0xea, 0x91, 0xd7, 0xf1, 0xed, 0x8e, 0xf3, 0xd6, 0xf8, 0x60, 0x76, 0x7d, 0xf6, 0x14, 0x88, 0x1f, 284 0x78, 0x66, 0x45, 0xaa, 0x4a, 0xf5, 0xd2, 0x5e, 0xad, 0xb1, 0xd0, 0xa7, 0x31, 0xa7, 0x7e, 0x17, 285 0x78, 0xa6, 0x86, 0x7a, 0xf6, 0x18, 0x88, 0x79, 0xd9, 0x37, 0x2a, 0xe9, 0xaa, 0x54, 0x2f, 0xb6, 286 0xe8, 0xe4, 0xcf, 0x23, 0xb2, 0xff, 0xfe, 0x75, 0xeb, 0x2e, 0x7a, 0x6b, 0x58, 0x0d, 0x55, 0xc3, 287 0x81, 0x7d, 0x56, 0xc9, 0x54, 0xa5, 0x7a, 0x56, 0xa8, 0x8e, 0xb4, 0x57, 0x2f, 0xef, 0xa2, 0xb7, 288 0x86, 0x55, 0xf6, 0x0c, 0x60, 0xd8, 0xeb, 0x78, 0x66, 0x1b, 0x49, 0x08, 0x92, 0x6c, 0x2f, 0x93, 289 0x84, 0x12, 0x24, 0xc8, 0x0f, 0xe3, 0x25, 0x7b, 0x0e, 0x45, 0x83, 0x5f, 0xb8, 0x67, 0xb6, 0x6b, 290 0xb5, 0x0d, 0x3e, 0xaa, 0x64, 0xab, 0x52, 0xbd, 0xb0, 0xb7, 0xb3, 0xb4, 0xb9, 0x15, 0x89, 0x5a, 291 0x7c, 0xa4, 0x15, 0x8c, 0x59, 0x50, 0x3b, 0x85, 0x42, 0xa2, 0xc6, 0xca, 0x40, 0x1c, 0xde, 0x1e, 292 0xa1, 0x1d, 0x92, 0x96, 0x71, 0xf8, 0x49, 0x98, 0xea, 0xd9, 0xed, 0x11, 0x7e, 0xa9, 0xa4, 0x65, 293 0x7a, 0xf6, 0x49, 0xa4, 0x0a, 0xf0, 0xb3, 0x50, 0x75, 0x1a, 0xa9, 0x02, 0xa4, 0x47, 0xd5, 0xe9, 294 0xee, 0xef, 0x2c, 0xe4, 0xa7, 0xd0, 0x2c, 0x0f, 0xd9, 0x63, 0x77, 0x68, 0xfa, 0x34, 0x15, 0x2e, 295 0x0f, 0xb9, 0xed, 0xfa, 0x54, 0x62, 0x25, 0x80, 0x37, 0xb6, 0x6b, 0x1e, 0xf9, 0x03, 0xdb, 0xb5, 296 0x68, 0x9a, 0x15, 0x60, 0xe5, 0x90, 0x3b, 0x81, 0xc5, 0x5d, 0x9a, 0x09, 0x8b, 0xea, 0x85, 0xe3, 297 0xdb, 0x42, 0x4c, 0xd8, 0x3a, 0xac, 0x61, 0x9c, 0xd8, 0x91, 0x65, 0x14, 0x8a, 0x91, 0x48, 0x6c, 298 0x93, 0x59, 0x11, 0x72, 0x07, 0x26, 0x3f, 0x37, 0xfd, 0x41, 0x40, 0x57, 0xd8, 0x16, 0xb0, 0x38, 299 0x7a, 0xc1, 0x1d, 0xc7, 0xec, 0xfa, 0x36, 0x77, 0x69, 0x8e, 0x95, 0x40, 0xc6, 0xbe, 0x2a, 0xfd, 300 0x38, 0x1e, 0x8f, 0xd3, 0x6c, 0x1d, 0x0a, 0xb3, 0xbe, 0x2a, 0xfd, 0x84, 0x49, 0x0a, 0xb9, 0xa8, 301 0xaf, 0x4a, 0x3f, 0xc7, 0xb2, 0x19, 0x93, 0x4a, 0xbf, 0x60, 0xb2, 0x02, 0x74, 0x01, 0x4c, 0xa5, 302 0x5f, 0xb1, 0xb2, 0x09, 0xab, 0x49, 0x3a, 0x95, 0x7e, 0xc3, 0x74, 0x19, 0xf2, 0x31, 0x94, 0x4a, 303 0xbf, 0x63, 0xea, 0x21, 0xac, 0x2f, 0x73, 0xaa, 0xf4, 0x07, 0x16, 0x63, 0x58, 0x1d, 0x61, 0xc9, 304 0x3c, 0xac, 0x8e, 0xb0, 0x24, 0x01, 0xab, 0x23, 0x2c, 0x99, 0x87, 0xd5, 0x11, 0x96, 0xdc, 0x03, 305 0xab, 0x23, 0x2c, 0x59, 0x84, 0xd5, 0x11, 0x96, 0x24, 0x61, 0x75, 0x84, 0x25, 0xf7, 0xc3, 0xea, 306 0x08, 0x4b, 0xd8, 0x5a, 0xf8, 0x1b, 0x86, 0x03, 0x85, 0xb5, 0x32, 0xdb, 0x80, 0x62, 0x62, 0x98, 307 0xf0, 0x56, 0x0e, 0xdb, 0xc6, 0x83, 0x84, 0xb9, 0x28, 0x4c, 0xf0, 0x0a, 0x77, 0x65, 0xf6, 0x00, 308 0xca, 0x8b, 0xc0, 0xc2, 0x5e, 0x99, 0x6d, 0x41, 0x69, 0x8e, 0x58, 0xf8, 0x2b, 0x33, 0x06, 0x30, 309 0x45, 0x16, 0x06, 0xcb, 0x6c, 0x07, 0x36, 0xee, 0x61, 0x16, 0x0e, 0xcb, 0xb5, 0x62, 0x6e, 0x1c, 310 0x3a, 0x4d, 0xf1, 0x19, 0x45, 0x04, 0x23, 0xb2, 0xbb, 0x0f, 0xe5, 0xa5, 0x6b, 0x20, 0x3c, 0xa9, 311 0xc7, 0x6e, 0xdf, 0xe5, 0x97, 0x2e, 0x4d, 0xb1, 0x32, 0xac, 0x1e, 0x98, 0xdc, 0x1a, 0x74, 0xbc, 312 0x5e, 0x10, 0x56, 0xa9, 0x14, 0x9e, 0xcb, 0x78, 0x1c, 0x66, 0xd2, 0xad, 0xc3, 0xab, 0x7f, 0x4a, 313 0xea, 0x6a, 0xa2, 0x48, 0xd7, 0x13, 0x45, 0xba, 0x99, 0x28, 0xd2, 0xdf, 0x89, 0x22, 0xfd, 0xba, 314 0x55, 0x52, 0xd7, 0xb7, 0x4a, 0xea, 0xe6, 0x56, 0x49, 0xe9, 0x0d, 0xcb, 0xf6, 0x7b, 0x17, 0x46, 315 0xa3, 0xcb, 0xcf, 0x9b, 0xd3, 0x7f, 0xf0, 0x99, 0x31, 0x5b, 0x37, 0xbd, 0xbe, 0xd5, 0x9c, 0xde, 316 0x80, 0x86, 0x8c, 0xb7, 0xda, 0x93, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0xf5, 0xea, 0xdd, 0x7f, 317 0x15, 0x05, 0x00, 0x00, 318 } 319 320 func (m *SpatialObject) Marshal() (dAtA []byte, err error) { 321 size := m.Size() 322 dAtA = make([]byte, size) 323 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 324 if err != nil { 325 return nil, err 326 } 327 return dAtA[:n], nil 328 } 329 330 func (m *SpatialObject) MarshalTo(dAtA []byte) (int, error) { 331 size := m.Size() 332 return m.MarshalToSizedBuffer(dAtA[:size]) 333 } 334 335 func (m *SpatialObject) MarshalToSizedBuffer(dAtA []byte) (int, error) { 336 i := len(dAtA) 337 _ = i 338 var l int 339 _ = l 340 if m.BoundingBox != nil { 341 { 342 size, err := m.BoundingBox.MarshalToSizedBuffer(dAtA[:i]) 343 if err != nil { 344 return 0, err 345 } 346 i -= size 347 i = encodeVarintGeopb(dAtA, i, uint64(size)) 348 } 349 i-- 350 dAtA[i] = 0x2a 351 } 352 if m.ShapeType != 0 { 353 i = encodeVarintGeopb(dAtA, i, uint64(m.ShapeType)) 354 i-- 355 dAtA[i] = 0x20 356 } 357 if m.SRID != 0 { 358 i = encodeVarintGeopb(dAtA, i, uint64(m.SRID)) 359 i-- 360 dAtA[i] = 0x18 361 } 362 if len(m.EWKB) > 0 { 363 i -= len(m.EWKB) 364 copy(dAtA[i:], m.EWKB) 365 i = encodeVarintGeopb(dAtA, i, uint64(len(m.EWKB))) 366 i-- 367 dAtA[i] = 0x12 368 } 369 if m.Type != 0 { 370 i = encodeVarintGeopb(dAtA, i, uint64(m.Type)) 371 i-- 372 dAtA[i] = 0x8 373 } 374 return len(dAtA) - i, nil 375 } 376 377 func (m *BoundingBox) Marshal() (dAtA []byte, err error) { 378 size := m.Size() 379 dAtA = make([]byte, size) 380 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 381 if err != nil { 382 return nil, err 383 } 384 return dAtA[:n], nil 385 } 386 387 func (m *BoundingBox) MarshalTo(dAtA []byte) (int, error) { 388 size := m.Size() 389 return m.MarshalToSizedBuffer(dAtA[:size]) 390 } 391 392 func (m *BoundingBox) MarshalToSizedBuffer(dAtA []byte) (int, error) { 393 i := len(dAtA) 394 _ = i 395 var l int 396 _ = l 397 if m.HiY != 0 { 398 i -= 8 399 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.HiY)))) 400 i-- 401 dAtA[i] = 0x21 402 } 403 if m.LoY != 0 { 404 i -= 8 405 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.LoY)))) 406 i-- 407 dAtA[i] = 0x19 408 } 409 if m.HiX != 0 { 410 i -= 8 411 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.HiX)))) 412 i-- 413 dAtA[i] = 0x11 414 } 415 if m.LoX != 0 { 416 i -= 8 417 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.LoX)))) 418 i-- 419 dAtA[i] = 0x9 420 } 421 return len(dAtA) - i, nil 422 } 423 424 func encodeVarintGeopb(dAtA []byte, offset int, v uint64) int { 425 offset -= sovGeopb(v) 426 base := offset 427 for v >= 1<<7 { 428 dAtA[offset] = uint8(v&0x7f | 0x80) 429 v >>= 7 430 offset++ 431 } 432 dAtA[offset] = uint8(v) 433 return base 434 } 435 func (m *SpatialObject) Size() (n int) { 436 if m == nil { 437 return 0 438 } 439 var l int 440 _ = l 441 if m.Type != 0 { 442 n += 1 + sovGeopb(uint64(m.Type)) 443 } 444 l = len(m.EWKB) 445 if l > 0 { 446 n += 1 + l + sovGeopb(uint64(l)) 447 } 448 if m.SRID != 0 { 449 n += 1 + sovGeopb(uint64(m.SRID)) 450 } 451 if m.ShapeType != 0 { 452 n += 1 + sovGeopb(uint64(m.ShapeType)) 453 } 454 if m.BoundingBox != nil { 455 l = m.BoundingBox.Size() 456 n += 1 + l + sovGeopb(uint64(l)) 457 } 458 return n 459 } 460 461 func (m *BoundingBox) Size() (n int) { 462 if m == nil { 463 return 0 464 } 465 var l int 466 _ = l 467 if m.LoX != 0 { 468 n += 9 469 } 470 if m.HiX != 0 { 471 n += 9 472 } 473 if m.LoY != 0 { 474 n += 9 475 } 476 if m.HiY != 0 { 477 n += 9 478 } 479 return n 480 } 481 482 func sovGeopb(x uint64) (n int) { 483 return (math_bits.Len64(x|1) + 6) / 7 484 } 485 func sozGeopb(x uint64) (n int) { 486 return sovGeopb(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 487 } 488 func (m *SpatialObject) Unmarshal(dAtA []byte) error { 489 l := len(dAtA) 490 iNdEx := 0 491 for iNdEx < l { 492 preIndex := iNdEx 493 var wire uint64 494 for shift := uint(0); ; shift += 7 { 495 if shift >= 64 { 496 return ErrIntOverflowGeopb 497 } 498 if iNdEx >= l { 499 return io.ErrUnexpectedEOF 500 } 501 b := dAtA[iNdEx] 502 iNdEx++ 503 wire |= uint64(b&0x7F) << shift 504 if b < 0x80 { 505 break 506 } 507 } 508 fieldNum := int32(wire >> 3) 509 wireType := int(wire & 0x7) 510 if wireType == 4 { 511 return fmt.Errorf("proto: SpatialObject: wiretype end group for non-group") 512 } 513 if fieldNum <= 0 { 514 return fmt.Errorf("proto: SpatialObject: illegal tag %d (wire type %d)", fieldNum, wire) 515 } 516 switch fieldNum { 517 case 1: 518 if wireType != 0 { 519 return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) 520 } 521 m.Type = 0 522 for shift := uint(0); ; shift += 7 { 523 if shift >= 64 { 524 return ErrIntOverflowGeopb 525 } 526 if iNdEx >= l { 527 return io.ErrUnexpectedEOF 528 } 529 b := dAtA[iNdEx] 530 iNdEx++ 531 m.Type |= SpatialObjectType(b&0x7F) << shift 532 if b < 0x80 { 533 break 534 } 535 } 536 case 2: 537 if wireType != 2 { 538 return fmt.Errorf("proto: wrong wireType = %d for field EWKB", wireType) 539 } 540 var byteLen int 541 for shift := uint(0); ; shift += 7 { 542 if shift >= 64 { 543 return ErrIntOverflowGeopb 544 } 545 if iNdEx >= l { 546 return io.ErrUnexpectedEOF 547 } 548 b := dAtA[iNdEx] 549 iNdEx++ 550 byteLen |= int(b&0x7F) << shift 551 if b < 0x80 { 552 break 553 } 554 } 555 if byteLen < 0 { 556 return ErrInvalidLengthGeopb 557 } 558 postIndex := iNdEx + byteLen 559 if postIndex < 0 { 560 return ErrInvalidLengthGeopb 561 } 562 if postIndex > l { 563 return io.ErrUnexpectedEOF 564 } 565 m.EWKB = append(m.EWKB[:0], dAtA[iNdEx:postIndex]...) 566 if m.EWKB == nil { 567 m.EWKB = []byte{} 568 } 569 iNdEx = postIndex 570 case 3: 571 if wireType != 0 { 572 return fmt.Errorf("proto: wrong wireType = %d for field SRID", wireType) 573 } 574 m.SRID = 0 575 for shift := uint(0); ; shift += 7 { 576 if shift >= 64 { 577 return ErrIntOverflowGeopb 578 } 579 if iNdEx >= l { 580 return io.ErrUnexpectedEOF 581 } 582 b := dAtA[iNdEx] 583 iNdEx++ 584 m.SRID |= SRID(b&0x7F) << shift 585 if b < 0x80 { 586 break 587 } 588 } 589 case 4: 590 if wireType != 0 { 591 return fmt.Errorf("proto: wrong wireType = %d for field ShapeType", wireType) 592 } 593 m.ShapeType = 0 594 for shift := uint(0); ; shift += 7 { 595 if shift >= 64 { 596 return ErrIntOverflowGeopb 597 } 598 if iNdEx >= l { 599 return io.ErrUnexpectedEOF 600 } 601 b := dAtA[iNdEx] 602 iNdEx++ 603 m.ShapeType |= ShapeType(b&0x7F) << shift 604 if b < 0x80 { 605 break 606 } 607 } 608 case 5: 609 if wireType != 2 { 610 return fmt.Errorf("proto: wrong wireType = %d for field BoundingBox", wireType) 611 } 612 var msglen int 613 for shift := uint(0); ; shift += 7 { 614 if shift >= 64 { 615 return ErrIntOverflowGeopb 616 } 617 if iNdEx >= l { 618 return io.ErrUnexpectedEOF 619 } 620 b := dAtA[iNdEx] 621 iNdEx++ 622 msglen |= int(b&0x7F) << shift 623 if b < 0x80 { 624 break 625 } 626 } 627 if msglen < 0 { 628 return ErrInvalidLengthGeopb 629 } 630 postIndex := iNdEx + msglen 631 if postIndex < 0 { 632 return ErrInvalidLengthGeopb 633 } 634 if postIndex > l { 635 return io.ErrUnexpectedEOF 636 } 637 if m.BoundingBox == nil { 638 m.BoundingBox = &BoundingBox{} 639 } 640 if err := m.BoundingBox.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 641 return err 642 } 643 iNdEx = postIndex 644 default: 645 iNdEx = preIndex 646 skippy, err := skipGeopb(dAtA[iNdEx:]) 647 if err != nil { 648 return err 649 } 650 if (skippy < 0) || (iNdEx+skippy) < 0 { 651 return ErrInvalidLengthGeopb 652 } 653 if (iNdEx + skippy) > l { 654 return io.ErrUnexpectedEOF 655 } 656 iNdEx += skippy 657 } 658 } 659 660 if iNdEx > l { 661 return io.ErrUnexpectedEOF 662 } 663 return nil 664 } 665 func (m *BoundingBox) Unmarshal(dAtA []byte) error { 666 l := len(dAtA) 667 iNdEx := 0 668 for iNdEx < l { 669 preIndex := iNdEx 670 var wire uint64 671 for shift := uint(0); ; shift += 7 { 672 if shift >= 64 { 673 return ErrIntOverflowGeopb 674 } 675 if iNdEx >= l { 676 return io.ErrUnexpectedEOF 677 } 678 b := dAtA[iNdEx] 679 iNdEx++ 680 wire |= uint64(b&0x7F) << shift 681 if b < 0x80 { 682 break 683 } 684 } 685 fieldNum := int32(wire >> 3) 686 wireType := int(wire & 0x7) 687 if wireType == 4 { 688 return fmt.Errorf("proto: BoundingBox: wiretype end group for non-group") 689 } 690 if fieldNum <= 0 { 691 return fmt.Errorf("proto: BoundingBox: illegal tag %d (wire type %d)", fieldNum, wire) 692 } 693 switch fieldNum { 694 case 1: 695 if wireType != 1 { 696 return fmt.Errorf("proto: wrong wireType = %d for field LoX", wireType) 697 } 698 var v uint64 699 if (iNdEx + 8) > l { 700 return io.ErrUnexpectedEOF 701 } 702 v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) 703 iNdEx += 8 704 m.LoX = float64(math.Float64frombits(v)) 705 case 2: 706 if wireType != 1 { 707 return fmt.Errorf("proto: wrong wireType = %d for field HiX", wireType) 708 } 709 var v uint64 710 if (iNdEx + 8) > l { 711 return io.ErrUnexpectedEOF 712 } 713 v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) 714 iNdEx += 8 715 m.HiX = float64(math.Float64frombits(v)) 716 case 3: 717 if wireType != 1 { 718 return fmt.Errorf("proto: wrong wireType = %d for field LoY", wireType) 719 } 720 var v uint64 721 if (iNdEx + 8) > l { 722 return io.ErrUnexpectedEOF 723 } 724 v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) 725 iNdEx += 8 726 m.LoY = float64(math.Float64frombits(v)) 727 case 4: 728 if wireType != 1 { 729 return fmt.Errorf("proto: wrong wireType = %d for field HiY", wireType) 730 } 731 var v uint64 732 if (iNdEx + 8) > l { 733 return io.ErrUnexpectedEOF 734 } 735 v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) 736 iNdEx += 8 737 m.HiY = float64(math.Float64frombits(v)) 738 default: 739 iNdEx = preIndex 740 skippy, err := skipGeopb(dAtA[iNdEx:]) 741 if err != nil { 742 return err 743 } 744 if (skippy < 0) || (iNdEx+skippy) < 0 { 745 return ErrInvalidLengthGeopb 746 } 747 if (iNdEx + skippy) > l { 748 return io.ErrUnexpectedEOF 749 } 750 iNdEx += skippy 751 } 752 } 753 754 if iNdEx > l { 755 return io.ErrUnexpectedEOF 756 } 757 return nil 758 } 759 func skipGeopb(dAtA []byte) (n int, err error) { 760 l := len(dAtA) 761 iNdEx := 0 762 depth := 0 763 for iNdEx < l { 764 var wire uint64 765 for shift := uint(0); ; shift += 7 { 766 if shift >= 64 { 767 return 0, ErrIntOverflowGeopb 768 } 769 if iNdEx >= l { 770 return 0, io.ErrUnexpectedEOF 771 } 772 b := dAtA[iNdEx] 773 iNdEx++ 774 wire |= (uint64(b) & 0x7F) << shift 775 if b < 0x80 { 776 break 777 } 778 } 779 wireType := int(wire & 0x7) 780 switch wireType { 781 case 0: 782 for shift := uint(0); ; shift += 7 { 783 if shift >= 64 { 784 return 0, ErrIntOverflowGeopb 785 } 786 if iNdEx >= l { 787 return 0, io.ErrUnexpectedEOF 788 } 789 iNdEx++ 790 if dAtA[iNdEx-1] < 0x80 { 791 break 792 } 793 } 794 case 1: 795 iNdEx += 8 796 case 2: 797 var length int 798 for shift := uint(0); ; shift += 7 { 799 if shift >= 64 { 800 return 0, ErrIntOverflowGeopb 801 } 802 if iNdEx >= l { 803 return 0, io.ErrUnexpectedEOF 804 } 805 b := dAtA[iNdEx] 806 iNdEx++ 807 length |= (int(b) & 0x7F) << shift 808 if b < 0x80 { 809 break 810 } 811 } 812 if length < 0 { 813 return 0, ErrInvalidLengthGeopb 814 } 815 iNdEx += length 816 case 3: 817 depth++ 818 case 4: 819 if depth == 0 { 820 return 0, ErrUnexpectedEndOfGroupGeopb 821 } 822 depth-- 823 case 5: 824 iNdEx += 4 825 default: 826 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 827 } 828 if iNdEx < 0 { 829 return 0, ErrInvalidLengthGeopb 830 } 831 if depth == 0 { 832 return iNdEx, nil 833 } 834 } 835 return 0, io.ErrUnexpectedEOF 836 } 837 838 var ( 839 ErrInvalidLengthGeopb = fmt.Errorf("proto: negative length found during unmarshaling") 840 ErrIntOverflowGeopb = fmt.Errorf("proto: integer overflow") 841 ErrUnexpectedEndOfGroupGeopb = fmt.Errorf("proto: unexpected end of group") 842 ) 843