cockroach: github.com/cockroachdb/cockroach/pkg/geo/geopb Index | Files

package geopb

import "github.com/cockroachdb/cockroach/pkg/geo/geopb"

Index

Package Files

geopb.go geopb.pb.go types.go

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,
}

type BoundingBox Uses

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 Uses

func (*BoundingBox) Descriptor() ([]byte, []int)

func (*BoundingBox) Marshal Uses

func (m *BoundingBox) Marshal() (dAtA []byte, err error)

func (*BoundingBox) MarshalTo Uses

func (m *BoundingBox) MarshalTo(dAtA []byte) (int, error)

func (*BoundingBox) ProtoMessage Uses

func (*BoundingBox) ProtoMessage()

func (*BoundingBox) Reset Uses

func (m *BoundingBox) Reset()

func (*BoundingBox) Size Uses

func (m *BoundingBox) Size() (n int)

func (*BoundingBox) String Uses

func (m *BoundingBox) String() string

func (*BoundingBox) Unmarshal Uses

func (m *BoundingBox) Unmarshal(dAtA []byte) error

func (*BoundingBox) XXX_DiscardUnknown Uses

func (m *BoundingBox) XXX_DiscardUnknown()

func (*BoundingBox) XXX_Marshal Uses

func (m *BoundingBox) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BoundingBox) XXX_Merge Uses

func (dst *BoundingBox) XXX_Merge(src proto.Message)

func (*BoundingBox) XXX_Size Uses

func (m *BoundingBox) XXX_Size() int

func (*BoundingBox) XXX_Unmarshal Uses

func (m *BoundingBox) XXX_Unmarshal(b []byte) error

type EWKB Uses

type EWKB []byte

EWKB is the Extended Well Known Bytes form of a spatial object.

type EWKT Uses

type EWKT string

EWKT is the Extended Well Known Text form of a spatial object.

type SRID Uses

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 Uses

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 Uses

func (ShapeType) EnumDescriptor() ([]byte, []int)

func (ShapeType) String Uses

func (x ShapeType) String() string

type SpatialObject Uses

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 Uses

func (*SpatialObject) Descriptor() ([]byte, []int)

func (*SpatialObject) EWKBHex Uses

func (b *SpatialObject) EWKBHex() string

EWKBHex returns the EWKB-hex version of this data type

func (*SpatialObject) Marshal Uses

func (m *SpatialObject) Marshal() (dAtA []byte, err error)

func (*SpatialObject) MarshalTo Uses

func (m *SpatialObject) MarshalTo(dAtA []byte) (int, error)

func (*SpatialObject) ProtoMessage Uses

func (*SpatialObject) ProtoMessage()

func (*SpatialObject) Reset Uses

func (m *SpatialObject) Reset()

func (*SpatialObject) Size Uses

func (m *SpatialObject) Size() (n int)

func (*SpatialObject) String Uses

func (m *SpatialObject) String() string

func (*SpatialObject) Unmarshal Uses

func (m *SpatialObject) Unmarshal(dAtA []byte) error

func (*SpatialObject) XXX_DiscardUnknown Uses

func (m *SpatialObject) XXX_DiscardUnknown()

func (*SpatialObject) XXX_Marshal Uses

func (m *SpatialObject) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SpatialObject) XXX_Merge Uses

func (dst *SpatialObject) XXX_Merge(src proto.Message)

func (*SpatialObject) XXX_Size Uses

func (m *SpatialObject) XXX_Size() int

func (*SpatialObject) XXX_Unmarshal Uses

func (m *SpatialObject) XXX_Unmarshal(b []byte) error

type SpatialObjectType Uses

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 Uses

func (SpatialObjectType) EnumDescriptor() ([]byte, []int)

func (SpatialObjectType) String Uses

func (x SpatialObjectType) String() string

type WKB Uses

type WKB []byte

WKB is the Well Known Bytes form of a spatial object.

type WKT Uses

type WKT string

WKT is the Well Known Text form of a spatial object.

Package geopb imports 5 packages (graph) and is imported by 26 packages. Updated 2020-08-12. Refresh now. Tools for package owners.