Documentation ¶
Index ¶
- Constants
- Variables
- type BoundingBox
- func (*BoundingBox) Descriptor() ([]byte, []int)
- func (m *BoundingBox) Marshal() (dAtA []byte, err error)
- func (m *BoundingBox) MarshalTo(dAtA []byte) (int, error)
- func (*BoundingBox) ProtoMessage()
- func (m *BoundingBox) Reset()
- func (m *BoundingBox) Size() (n int)
- func (m *BoundingBox) String() string
- func (m *BoundingBox) Unmarshal(dAtA []byte) error
- func (m *BoundingBox) XXX_DiscardUnknown()
- func (m *BoundingBox) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *BoundingBox) XXX_Merge(src proto.Message)
- func (m *BoundingBox) XXX_Size() int
- func (m *BoundingBox) XXX_Unmarshal(b []byte) error
- type EWKB
- type EWKT
- type SRID
- type ShapeType
- type SpatialObject
- func (*SpatialObject) Descriptor() ([]byte, []int)
- func (b *SpatialObject) EWKBHex() string
- func (m *SpatialObject) Marshal() (dAtA []byte, err error)
- func (m *SpatialObject) MarshalTo(dAtA []byte) (int, error)
- func (*SpatialObject) ProtoMessage()
- func (m *SpatialObject) Reset()
- func (m *SpatialObject) Size() (n int)
- func (m *SpatialObject) String() string
- func (m *SpatialObject) Unmarshal(dAtA []byte) error
- func (m *SpatialObject) XXX_DiscardUnknown()
- func (m *SpatialObject) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *SpatialObject) XXX_Merge(src proto.Message)
- func (m *SpatialObject) XXX_Size() int
- func (m *SpatialObject) XXX_Unmarshal(b []byte) error
- type SpatialObjectType
- type WKB
- type WKT
Constants ¶
const ( // UnknownSRID is the default SRID if none is provided. UnknownSRID = SRID(0) // DefaultGeometrySRID is the same as being unknown. DefaultGeometrySRID = UnknownSRID // DefaultGeographySRID (aka 4326) is the GPS lat/lng we all know and love. // In this system, (long, lat) corresponds to (X, Y), bounded by // ([-180, 180], [-90 90]). DefaultGeographySRID = SRID(4326) )
The following are the common standard SRIDs that we support.
Variables ¶
var ( ErrInvalidLengthGeopb = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowGeopb = fmt.Errorf("proto: integer overflow") )
var ShapeType_name = map[int32]string{
0: "Unset",
1: "Point",
2: "LineString",
3: "Polygon",
4: "MultiPoint",
5: "MultiLineString",
6: "MultiPolygon",
7: "Geometry",
8: "GeometryCollection",
}
var ShapeType_value = map[string]int32{
"Unset": 0,
"Point": 1,
"LineString": 2,
"Polygon": 3,
"MultiPoint": 4,
"MultiLineString": 5,
"MultiPolygon": 6,
"Geometry": 7,
"GeometryCollection": 8,
}
var SpatialObjectType_name = map[int32]string{
0: "Unknown",
1: "GeographyType",
2: "GeometryType",
}
var SpatialObjectType_value = map[string]int32{
"Unknown": 0,
"GeographyType": 1,
"GeometryType": 2,
}
Functions ¶
This section is empty.
Types ¶
type BoundingBox ¶
type BoundingBox struct { LoX float64 `protobuf:"fixed64,1,opt,name=lo_x,json=loX,proto3" json:"lo_x,omitempty"` HiX float64 `protobuf:"fixed64,2,opt,name=hi_x,json=hiX,proto3" json:"hi_x,omitempty"` LoY float64 `protobuf:"fixed64,3,opt,name=lo_y,json=loY,proto3" json:"lo_y,omitempty"` HiY float64 `protobuf:"fixed64,4,opt,name=hi_y,json=hiY,proto3" json:"hi_y,omitempty"` }
BoundingBox represents the bounding box of a Geospatial type. Note the lo coordinates can be higher in value than the hi coordinates for spherical geometries. NOTE: Do not use these to compare bounding boxes. Use the library functions provided in the geo package to perform these calculations.
func (*BoundingBox) Descriptor ¶
func (*BoundingBox) Descriptor() ([]byte, []int)
func (*BoundingBox) Marshal ¶
func (m *BoundingBox) Marshal() (dAtA []byte, err error)
func (*BoundingBox) ProtoMessage ¶
func (*BoundingBox) ProtoMessage()
func (*BoundingBox) Reset ¶
func (m *BoundingBox) Reset()
func (*BoundingBox) Size ¶
func (m *BoundingBox) Size() (n int)
func (*BoundingBox) String ¶
func (m *BoundingBox) String() string
func (*BoundingBox) Unmarshal ¶
func (m *BoundingBox) Unmarshal(dAtA []byte) error
func (*BoundingBox) XXX_DiscardUnknown ¶
func (m *BoundingBox) XXX_DiscardUnknown()
func (*BoundingBox) XXX_Marshal ¶
func (m *BoundingBox) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*BoundingBox) XXX_Merge ¶
func (dst *BoundingBox) XXX_Merge(src proto.Message)
func (*BoundingBox) XXX_Size ¶
func (m *BoundingBox) XXX_Size() int
func (*BoundingBox) XXX_Unmarshal ¶
func (m *BoundingBox) XXX_Unmarshal(b []byte) error
type SRID ¶
type SRID int32
SRID is a Spatial Reference Identifer. All geometry and geography shapes are stored and represented as using coordinates that are bare floats. SRIDs tie these floats to the planar or spherical coordinate system, allowing them to be interpreted and compared.
The zero value is special and means an unknown coordinate system.
type ShapeType ¶
type ShapeType int32
ShapeType is the type of a spatial shape. Each of these corresponds to a different representation and serialization format. For example, a Point is a pair of doubles (or more than that for geometries with Z or N), a LineString is an ordered series of Points, etc.
const ( ShapeType_Unset ShapeType = 0 ShapeType_Point ShapeType = 1 ShapeType_LineString ShapeType = 2 ShapeType_Polygon ShapeType = 3 ShapeType_MultiPoint ShapeType = 4 ShapeType_MultiLineString ShapeType = 5 ShapeType_MultiPolygon ShapeType = 6 // Geometry can contain any type. ShapeType_Geometry ShapeType = 7 // GeometryCollection can contain a list of any above type except for Geometry. ShapeType_GeometryCollection ShapeType = 8 )
func (ShapeType) EnumDescriptor ¶
type SpatialObject ¶
type SpatialObject struct { // Type is the type of the SpatialObject. Type SpatialObjectType `protobuf:"varint,1,opt,name=type,proto3,enum=cockroach.geopb.SpatialObjectType" json:"type,omitempty"` // EWKB is the EWKB representation of the spatial object. EWKB EWKB `protobuf:"bytes,2,opt,name=ewkb,proto3,casttype=EWKB" json:"ewkb,omitempty"` // SRID is the denormalized SRID derived from the EWKB. SRID SRID `protobuf:"varint,3,opt,name=srid,proto3,casttype=SRID" json:"srid,omitempty"` // ShapeType is denormalized ShapeType derived from the EWKB. ShapeType ShapeType `protobuf:"varint,4,opt,name=shape_type,json=shapeType,proto3,enum=cockroach.geopb.ShapeType" json:"shape_type,omitempty"` // BoundingBox is the bounding box of the SpatialObject. BoundingBox *BoundingBox `protobuf:"bytes,5,opt,name=bounding_box,json=boundingBox,proto3" json:"bounding_box,omitempty"` }
SpatialObject represents a serialization of a Geospatial type.
func (*SpatialObject) Descriptor ¶
func (*SpatialObject) Descriptor() ([]byte, []int)
func (*SpatialObject) EWKBHex ¶
func (b *SpatialObject) EWKBHex() string
EWKBHex returns the EWKB-hex version of this data type
func (*SpatialObject) Marshal ¶
func (m *SpatialObject) Marshal() (dAtA []byte, err error)
func (*SpatialObject) ProtoMessage ¶
func (*SpatialObject) ProtoMessage()
func (*SpatialObject) Reset ¶
func (m *SpatialObject) Reset()
func (*SpatialObject) Size ¶
func (m *SpatialObject) Size() (n int)
func (*SpatialObject) String ¶
func (m *SpatialObject) String() string
func (*SpatialObject) Unmarshal ¶
func (m *SpatialObject) Unmarshal(dAtA []byte) error
func (*SpatialObject) XXX_DiscardUnknown ¶
func (m *SpatialObject) XXX_DiscardUnknown()
func (*SpatialObject) XXX_Marshal ¶
func (m *SpatialObject) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*SpatialObject) XXX_Merge ¶
func (dst *SpatialObject) XXX_Merge(src proto.Message)
func (*SpatialObject) XXX_Size ¶
func (m *SpatialObject) XXX_Size() int
func (*SpatialObject) XXX_Unmarshal ¶
func (m *SpatialObject) XXX_Unmarshal(b []byte) error
type SpatialObjectType ¶
type SpatialObjectType int32
SpatialObjectType represents the type of the SpatialObject.
const ( SpatialObjectType_Unknown SpatialObjectType = 0 SpatialObjectType_GeographyType SpatialObjectType = 1 SpatialObjectType_GeometryType SpatialObjectType = 2 )
func (SpatialObjectType) EnumDescriptor ¶
func (SpatialObjectType) EnumDescriptor() ([]byte, []int)
func (SpatialObjectType) String ¶
func (x SpatialObjectType) String() string