geom

package
v0.0.0-...-3aae512 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2024 License: Apache-2.0 Imports: 25 Imported by: 1

Documentation

Index

Constants

View Source
const (
	E7 = 10000000.0
	E2 = 100.0
)
View Source
const (
	XPI    = math.Pi * 3000.0 / 180.0
	OFFSET = 0.00669342162296594323
	AXIS   = 6378245.0
)
View Source
const (
	WKBPoint              uint32 = 1
	WKBLineString         uint32 = 2
	WKBPolygon            uint32 = 3
	WKBMultiPoint         uint32 = 4
	WKBMultiLineString    uint32 = 5
	WKBMultiPolygon       uint32 = 6
	WKBGeometryCollection uint32 = 7
)
View Source
const (
	// EarthRadius According to Wikipedia, the Earth's radius is about 6,371,004 m
	EarthRadius = 6371000
)
View Source
const EarthRadiusMeters = 1000 * 6371
View Source
const Empty = "EMPTY"

Variables

View Source
var (
	SpatialReference_name = map[int32]string{
		0: "SPATIAL_REFERENCE_UNSPECIFIED",
		1: "SPATIAL_REFERENCE_WGS84",
		2: "SPATIAL_REFERENCE_GCJ02",
		3: "SPATIAL_REFERENCE_BD09",
		4: "SPATIAL_REFERENCE_CGCS2000",
		5: "SPATIAL_REFERENCE_SH2000",
	}
	SpatialReference_value = map[string]int32{
		"SPATIAL_REFERENCE_UNSPECIFIED": 0,
		"SPATIAL_REFERENCE_WGS84":       1,
		"SPATIAL_REFERENCE_GCJ02":       2,
		"SPATIAL_REFERENCE_BD09":        3,
		"SPATIAL_REFERENCE_CGCS2000":    4,
		"SPATIAL_REFERENCE_SH2000":      5,
	}
)

Enum value maps for SpatialReference.

View Source
var File_mojo_geom_bin_lng_lat_proto protoreflect.FileDescriptor
View Source
var File_mojo_geom_bounding_box_proto protoreflect.FileDescriptor
View Source
var File_mojo_geom_circle_proto protoreflect.FileDescriptor
View Source
var File_mojo_geom_feature_collection_proto protoreflect.FileDescriptor
View Source
var File_mojo_geom_feature_proto protoreflect.FileDescriptor
View Source
var File_mojo_geom_geo_json_proto protoreflect.FileDescriptor
View Source
var File_mojo_geom_geom_proto protoreflect.FileDescriptor
View Source
var File_mojo_geom_line_string_proto protoreflect.FileDescriptor
View Source
var File_mojo_geom_lng_lat_proto protoreflect.FileDescriptor
View Source
var File_mojo_geom_multi_line_string_proto protoreflect.FileDescriptor
View Source
var File_mojo_geom_multi_point_proto protoreflect.FileDescriptor
View Source
var File_mojo_geom_multi_polygon_proto protoreflect.FileDescriptor
View Source
var File_mojo_geom_point_proto protoreflect.FileDescriptor
View Source
var File_mojo_geom_polygon_proto protoreflect.FileDescriptor
View Source
var File_mojo_geom_spatial_reference_proto protoreflect.FileDescriptor
View Source
var SpatialReferenceNames = map[int32]string{
	0: "unspecified",
	1: "wgs84",
	2: "gcj02",
	3: "bd09",
	4: "cgcs2000",
	5: "sh2000",
}

Functions

func BD09toGCJ02

func BD09toGCJ02(lon, lat float64) (float64, float64)

BD09toGCJ02 百度坐标系->火星坐标系

func BD09toWGS84

func BD09toWGS84(lon, lat float64) (float64, float64)

BD09toWGS84 百度坐标系->WGS84坐标系

func CellTokens

func CellTokens(cells s2.CellUnion) [][]byte

func Distance

func Distance(lng1, lat1, lng2, lat2 float64) float64

Distance function returns the distance (in meters) between two points of

a given longitude and latitude relatively accurately (using a spherical
approximation of the Earth) through the Haversin Distance Formula for
great arc distance on a sphere with accuracy for small distances

point coordinates are supplied in degrees and converted into rad. in the func

distance returned is METERS!!!!!! http://en.wikipedia.org/wiki/Haversine_formula

func DistanceBetween

func DistanceBetween(pt1 *LngLat, pt2 *LngLat) float64

func EarthAngle

func EarthAngle(dist float64) s1.Angle

EarthAngle converts a to distance on earth in meters to an angle

func EncodeBinLngLat

func EncodeBinLngLat(point *LngLat) []int32

func GCJ02toBD09

func GCJ02toBD09(lon, lat float64) (float64, float64)

GCJ02toBD09 火星坐标系->百度坐标系

func GCJ02toWGS84

func GCJ02toWGS84(lon, lat float64) (float64, float64)

GCJ02toWGS84 火星坐标系->WGS84坐标系

func LatLngToDegrees

func LatLngToDegrees(latLng s2.LatLng) s2.LatLng

func WGS84toBD09

func WGS84toBD09(lon, lat float64) (float64, float64)

WGS84toBD09 WGS84坐标系->百度坐标系

func WGS84toGCJ02

func WGS84toGCJ02(lon, lat float64) (float64, float64)

WGS84toGCJ02 WGS84坐标系->火星坐标系

Types

type Area

type Area float64

Area denotes an area on Earth

func EarthArea

func EarthArea(a float64) Area

EarthArea converts an area on the unit sphere to an area on earth in sq. meters.

func (Area) Km2

func (a Area) Km2() float64

func (Area) String

func (a Area) String() string

String converts the area to human-readable units

type BinLngLat

type BinLngLat struct {
	Longitude int32 `protobuf:"varint,1,opt,name=longitude,proto3" json:"longitude,omitempty"`
	Latitude  int32 `protobuf:"varint,2,opt,name=latitude,proto3" json:"latitude,omitempty"`
	Altitude  int32 `protobuf:"varint,3,opt,name=altitude,proto3" json:"altitude,omitempty"`
	// contains filtered or unexported fields
}

func NewBinLngLat

func NewBinLngLat(lng, lat int32) *BinLngLat

func NewBinLngLatWith

func NewBinLngLatWith(point *LngLat) *BinLngLat

func (*BinLngLat) Decode

func (x *BinLngLat) Decode() *LngLat

func (*BinLngLat) Descriptor deprecated

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

Deprecated: Use BinLngLat.ProtoReflect.Descriptor instead.

func (*BinLngLat) Encode

func (x *BinLngLat) Encode(lnglat *LngLat) *BinLngLat

func (*BinLngLat) GetAltitude

func (x *BinLngLat) GetAltitude() int32

func (*BinLngLat) GetLatitude

func (x *BinLngLat) GetLatitude() int32

func (*BinLngLat) GetLongitude

func (x *BinLngLat) GetLongitude() int32

func (*BinLngLat) ProtoMessage

func (*BinLngLat) ProtoMessage()

func (*BinLngLat) ProtoReflect

func (x *BinLngLat) ProtoReflect() protoreflect.Message

func (*BinLngLat) Reset

func (x *BinLngLat) Reset()

func (*BinLngLat) String

func (x *BinLngLat) String() string

type BoundingBox

type BoundingBox struct {
	LeftBottom *LngLat `protobuf:"bytes,1,opt,name=left_bottom,json=leftBottom,proto3" json:"leftBottom,omitempty"`
	RightTop   *LngLat `protobuf:"bytes,2,opt,name=right_top,json=rightTop,proto3" json:"rightTop,omitempty"`
	// contains filtered or unexported fields
}

func GeoHashBox

func GeoHashBox(hash string) *BoundingBox

func NewBoundingBox

func NewBoundingBox(leftBottom *LngLat, rightTop *LngLat) *BoundingBox

func (*BoundingBox) Descriptor deprecated

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

Deprecated: Use BoundingBox.ProtoReflect.Descriptor instead.

func (*BoundingBox) Extend

func (x *BoundingBox) Extend(box *BoundingBox) *BoundingBox

func (*BoundingBox) ExtendDegree

func (x *BoundingBox) ExtendDegree(lng float64, lat float64) *BoundingBox

func (*BoundingBox) GeoHashCovering

func (x *BoundingBox) GeoHashCovering(minLevel, maxLevel, maxHashes int) []string

func (*BoundingBox) GetLeftBottom

func (x *BoundingBox) GetLeftBottom() *LngLat

func (*BoundingBox) GetRightTop

func (x *BoundingBox) GetRightTop() *LngLat

func (*BoundingBox) ProtoMessage

func (*BoundingBox) ProtoMessage()

func (*BoundingBox) ProtoReflect

func (x *BoundingBox) ProtoReflect() protoreflect.Message

func (*BoundingBox) Reset

func (x *BoundingBox) Reset()

func (*BoundingBox) String

func (x *BoundingBox) String() string

func (*BoundingBox) Vertex

func (x *BoundingBox) Vertex(index int) *LngLat

func (*BoundingBox) Vertexes

func (x *BoundingBox) Vertexes() []*LngLat

type Circle

type Circle struct {
	Type   string  `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	Center *LngLat `protobuf:"bytes,2,opt,name=center,proto3" json:"coordinates,omitempty"`
	Radius float32 `protobuf:"fixed32,5,opt,name=radius,proto3" json:"radius,omitempty"`
	// contains filtered or unexported fields
}

func (*Circle) CellCovering

func (x *Circle) CellCovering(minLevel, maxLevel, maxCells int) s2.CellUnion

func (*Circle) Descriptor deprecated

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

Deprecated: Use Circle.ProtoReflect.Descriptor instead.

func (*Circle) GeoHashCovering

func (x *Circle) GeoHashCovering(minLevel, maxLevel, maxHashes int) []string

func (*Circle) GeoHashFractionCovering

func (x *Circle) GeoHashFractionCovering(minLevel, maxLevel, maxHashes int, fraction float32) []string

func (*Circle) GetCenter

func (x *Circle) GetCenter() *LngLat

func (*Circle) GetRadius

func (x *Circle) GetRadius() float32

func (*Circle) GetType

func (x *Circle) GetType() string

func (*Circle) ProtoMessage

func (*Circle) ProtoMessage()

func (*Circle) ProtoReflect

func (x *Circle) ProtoReflect() protoreflect.Message

func (*Circle) Reset

func (x *Circle) Reset()

func (*Circle) Scan

func (x *Circle) Scan(src interface{}) error

func (*Circle) String

func (x *Circle) String() string

func (*Circle) ToPolygon

func (x *Circle) ToPolygon(numberOfSegments int) *Polygon

func (*Circle) Value

func (x *Circle) Value() (driver.Value, error)

Value Implement driver.Valuer and sql.Scanner interfaces on Brand

type Feature

type Feature struct {
	Type             string                 `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	Id               *core.Id               `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	Geometry         *Geometry              `protobuf:"bytes,3,opt,name=geometry,proto3" json:"geometry,omitempty"`
	Bbox             *BoundingBox           `protobuf:"bytes,4,opt,name=bbox,proto3" json:"bbox,omitempty"`
	SpatialReference SpatialReference       `` /* 128-byte string literal not displayed */
	Properties       map[string]*core.Value `` /* 161-byte string literal not displayed */
	// contains filtered or unexported fields
}

func NewFeature

func NewFeature(geometry *Geometry) *Feature

func NewLineStringFeature

func NewLineStringFeature(coordinates ...*LngLat) *Feature

func NewPointFeature

func NewPointFeature(ll *LngLat) *Feature

func NewPointFeatureFrom

func NewPointFeatureFrom(coordinates ...float64) *Feature

func NewPolygonFeatureFrom

func NewPolygonFeatureFrom(coordinates ...*LngLat) *Feature

func (*Feature) Descriptor deprecated

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

Deprecated: Use Feature.ProtoReflect.Descriptor instead.

func (*Feature) GetBbox

func (x *Feature) GetBbox() *BoundingBox

func (*Feature) GetBoolProperty

func (x *Feature) GetBoolProperty(key string) (bool, error)

func (*Feature) GetDoubleProperty

func (x *Feature) GetDoubleProperty(key string) (float64, error)

func (*Feature) GetFloat64Property

func (x *Feature) GetFloat64Property(key string) (float64, error)

func (*Feature) GetGeometry

func (x *Feature) GetGeometry() *Geometry

func (*Feature) GetId

func (x *Feature) GetId() *core.Id

func (*Feature) GetIntProperty

func (x *Feature) GetIntProperty(key string) (int64, error)

func (*Feature) GetLineString

func (x *Feature) GetLineString() *LineString

func (*Feature) GetPoint

func (x *Feature) GetPoint() *Point

func (*Feature) GetPolygon

func (x *Feature) GetPolygon() *Polygon

func (*Feature) GetProperties

func (x *Feature) GetProperties() map[string]*core.Value

func (*Feature) GetProperty

func (x *Feature) GetProperty(key string) (*core.Value, error)

func (*Feature) GetSpatialReference

func (x *Feature) GetSpatialReference() SpatialReference

func (*Feature) GetStringProperty

func (x *Feature) GetStringProperty(key string) (string, error)

func (*Feature) GetType

func (x *Feature) GetType() string

func (*Feature) ProtoMessage

func (*Feature) ProtoMessage()

func (*Feature) ProtoReflect

func (x *Feature) ProtoReflect() protoreflect.Message

func (*Feature) Reset

func (x *Feature) Reset()

func (*Feature) SetBool

func (x *Feature) SetBool(key string, val bool) *Feature

func (*Feature) SetDouble

func (x *Feature) SetDouble(key string, val float64) *Feature

func (*Feature) SetInt64

func (x *Feature) SetInt64(key string, val int64) *Feature

func (*Feature) SetIntId

func (x *Feature) SetIntId(id uint64)

func (*Feature) SetProperty

func (x *Feature) SetProperty(key string, val *core.Value) *Feature

func (*Feature) SetString

func (x *Feature) SetString(key string, val string) *Feature

func (*Feature) SetStringId

func (x *Feature) SetStringId(id string)

func (*Feature) String

func (x *Feature) String() string

type FeatureCodec

type FeatureCodec struct {
}

func (*FeatureCodec) Decode

func (codec *FeatureCodec) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator)

func (*FeatureCodec) Encode

func (codec *FeatureCodec) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)

func (*FeatureCodec) IsEmpty

func (codec *FeatureCodec) IsEmpty(ptr unsafe.Pointer) bool

type FeatureCollection

type FeatureCollection struct {
	Type     string        `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	Features []*Feature    `protobuf:"bytes,5,rep,name=features,proto3" json:"features,omitempty"`
	Keys     []string      `protobuf:"bytes,13,rep,name=keys,proto3" json:"keys,omitempty"`
	Values   []*core.Value `protobuf:"bytes,14,rep,name=values,proto3" json:"values,omitempty"`
	// contains filtered or unexported fields
}

func NewFeatureCollection

func NewFeatureCollection(features ...*Feature) *FeatureCollection

func (*FeatureCollection) AddFeatures

func (x *FeatureCollection) AddFeatures(features ...*Feature)

func (*FeatureCollection) Descriptor deprecated

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

Deprecated: Use FeatureCollection.ProtoReflect.Descriptor instead.

func (*FeatureCollection) GetFeatures

func (x *FeatureCollection) GetFeatures() []*Feature

func (*FeatureCollection) GetKeys

func (x *FeatureCollection) GetKeys() []string

func (*FeatureCollection) GetType

func (x *FeatureCollection) GetType() string

func (*FeatureCollection) GetValues

func (x *FeatureCollection) GetValues() []*core.Value

func (*FeatureCollection) ProtoMessage

func (*FeatureCollection) ProtoMessage()

func (*FeatureCollection) ProtoReflect

func (x *FeatureCollection) ProtoReflect() protoreflect.Message

func (*FeatureCollection) Reset

func (x *FeatureCollection) Reset()

func (*FeatureCollection) String

func (x *FeatureCollection) String() string

type FeatureCollectionCodec

type FeatureCollectionCodec struct {
}

func (*FeatureCollectionCodec) Decode

func (codec *FeatureCollectionCodec) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator)

func (*FeatureCollectionCodec) Encode

func (codec *FeatureCollectionCodec) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)

func (*FeatureCollectionCodec) IsEmpty

func (codec *FeatureCollectionCodec) IsEmpty(ptr unsafe.Pointer) bool

type GeoJson

type GeoJson struct {

	// Types that are assignable to GeoJson:
	//
	//	*GeoJson_Point
	//	*GeoJson_MultiPoint
	//	*GeoJson_LineString
	//	*GeoJson_MultiLineString
	//	*GeoJson_Polygon
	//	*GeoJson_MultiPolygon
	//	*GeoJson_GeometryCollection
	//	*GeoJson_Feature
	//	*GeoJson_FeatureCollection
	GeoJson isGeoJson_GeoJson `protobuf_oneof:"geo_json" json:"geoJson,omitempty"`
	// contains filtered or unexported fields
}

func NewFeatureCollectionGeoJson

func NewFeatureCollectionGeoJson(features ...*Feature) *GeoJson

func NewGeoJson

func NewGeoJson(data interface{}) *GeoJson

func NewLineStringGeoJson

func NewLineStringGeoJson(coordinates ...*LngLat) *GeoJson

func NewPointGeoJson

func NewPointGeoJson(coordinates *LngLat) *GeoJson

func NewPointGeoJsonFrom

func NewPointGeoJsonFrom(coordinates ...float64) *GeoJson

func NewPolygonGeoJson

func NewPolygonGeoJson(lineStrings ...*LineString) *GeoJson

func NewPolygonGeoJsonFrom

func NewPolygonGeoJsonFrom(coordinates ...*LngLat) *GeoJson

func (*GeoJson) Descriptor deprecated

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

Deprecated: Use GeoJson.ProtoReflect.Descriptor instead.

func (*GeoJson) GetFeature

func (x *GeoJson) GetFeature() *Feature

func (*GeoJson) GetFeatureCollection

func (x *GeoJson) GetFeatureCollection() *FeatureCollection

func (*GeoJson) GetGeoJson

func (m *GeoJson) GetGeoJson() isGeoJson_GeoJson

func (*GeoJson) GetGeometryCollection

func (x *GeoJson) GetGeometryCollection() *GeometryCollection

func (*GeoJson) GetLineString

func (x *GeoJson) GetLineString() *LineString

func (*GeoJson) GetMultiLineString

func (x *GeoJson) GetMultiLineString() *MultiLineString

func (*GeoJson) GetMultiPoint

func (x *GeoJson) GetMultiPoint() *MultiPoint

func (*GeoJson) GetMultiPolygon

func (x *GeoJson) GetMultiPolygon() *MultiPolygon

func (*GeoJson) GetPoint

func (x *GeoJson) GetPoint() *Point

func (*GeoJson) GetPolygon

func (x *GeoJson) GetPolygon() *Polygon

func (*GeoJson) ProtoMessage

func (*GeoJson) ProtoMessage()

func (*GeoJson) ProtoReflect

func (x *GeoJson) ProtoReflect() protoreflect.Message

func (*GeoJson) Reset

func (x *GeoJson) Reset()

func (*GeoJson) String

func (x *GeoJson) String() string

type GeoJsonCodec

type GeoJsonCodec struct {
}

func (*GeoJsonCodec) Decode

func (codec *GeoJsonCodec) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator)

func (*GeoJsonCodec) Encode

func (codec *GeoJsonCodec) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)

func (*GeoJsonCodec) IsEmpty

func (codec *GeoJsonCodec) IsEmpty(ptr unsafe.Pointer) bool

type GeoJson_Feature

type GeoJson_Feature struct {
	Feature *Feature `protobuf:"bytes,10,opt,name=feature,proto3,oneof" json:"feature,omitempty"`
}

type GeoJson_FeatureCollection

type GeoJson_FeatureCollection struct {
	FeatureCollection *FeatureCollection `protobuf:"bytes,11,opt,name=feature_collection,json=featureCollection,proto3,oneof" json:"featureCollection,omitempty"`
}

type GeoJson_GeometryCollection

type GeoJson_GeometryCollection struct {
	GeometryCollection *GeometryCollection `protobuf:"bytes,7,opt,name=geometry_collection,json=geometryCollection,proto3,oneof" json:"geometryCollection,omitempty"`
}

type GeoJson_LineString

type GeoJson_LineString struct {
	LineString *LineString `protobuf:"bytes,3,opt,name=line_string,json=lineString,proto3,oneof" json:"lineString,omitempty"`
}

type GeoJson_MultiLineString

type GeoJson_MultiLineString struct {
	MultiLineString *MultiLineString `protobuf:"bytes,4,opt,name=multi_line_string,json=multiLineString,proto3,oneof" json:"multiLineString,omitempty"`
}

type GeoJson_MultiPoint

type GeoJson_MultiPoint struct {
	MultiPoint *MultiPoint `protobuf:"bytes,2,opt,name=multi_point,json=multiPoint,proto3,oneof" json:"multiPoint,omitempty"`
}

type GeoJson_MultiPolygon

type GeoJson_MultiPolygon struct {
	MultiPolygon *MultiPolygon `protobuf:"bytes,6,opt,name=multi_polygon,json=multiPolygon,proto3,oneof" json:"multiPolygon,omitempty"`
}

type GeoJson_Point

type GeoJson_Point struct {
	Point *Point `protobuf:"bytes,1,opt,name=point,proto3,oneof" json:"point,omitempty"`
}

type GeoJson_Polygon

type GeoJson_Polygon struct {
	Polygon *Polygon `protobuf:"bytes,5,opt,name=polygon,proto3,oneof" json:"polygon,omitempty"`
}

type Geometry

type Geometry struct {

	// Types that are assignable to Geometry:
	//
	//	*Geometry_Point
	//	*Geometry_MultiPoint
	//	*Geometry_LineString
	//	*Geometry_MultiLineString
	//	*Geometry_Polygon
	//	*Geometry_MultiPolygon
	//	*Geometry_GeometryCollection
	Geometry isGeometry_Geometry `protobuf_oneof:"geometry" json:"geometry,omitempty"`
	// contains filtered or unexported fields
}

func CellToPolygon

func CellToPolygon(cid s2.CellID) *Geometry

func NewGeometry

func NewGeometry(val interface{}) *Geometry

func NewGeometryCollectionGeometry

func NewGeometryCollectionGeometry(geometries ...*Geometry) *Geometry

func NewGeometryFromWKB

func NewGeometryFromWKB(wkb []byte) (*Geometry, error)

func NewGeometryFromWKT

func NewGeometryFromWKT(wkt string) (*Geometry, error)

func NewLineStringGeometry

func NewLineStringGeometry(coordinates ...*LngLat) *Geometry

func NewMultiLineStringGeometry

func NewMultiLineStringGeometry(lineStrings ...*LineString) *Geometry

func NewMultiLineStringGeometryFrom

func NewMultiLineStringGeometryFrom(coordinates ...[]*LngLat) *Geometry

func NewMultiPointGeometry

func NewMultiPointGeometry(points ...*Point) *Geometry

func NewMultiPointGeometryFrom

func NewMultiPointGeometryFrom(points ...*LngLat) *Geometry

func NewMultiPolygonGeometry

func NewMultiPolygonGeometry(p ...*Polygon) *Geometry

func NewPointGeometry

func NewPointGeometry(ll *LngLat) *Geometry

func NewPointGeometryFrom

func NewPointGeometryFrom(coordinates ...float64) *Geometry

func NewPolygonGeometry

func NewPolygonGeometry(lineStrings ...*LineString) *Geometry

func NewPolygonGeometryFrom

func NewPolygonGeometryFrom(coordinates ...*LngLat) *Geometry

func (*Geometry) Descriptor deprecated

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

Deprecated: Use Geometry.ProtoReflect.Descriptor instead.

func (*Geometry) FromWKB

func (x *Geometry) FromWKB(wkb []byte) error

func (*Geometry) FromWKT

func (x *Geometry) FromWKT(wkt string) error

func (*Geometry) GetGeometry

func (m *Geometry) GetGeometry() isGeometry_Geometry

func (*Geometry) GetGeometryCollection

func (x *Geometry) GetGeometryCollection() *GeometryCollection

func (*Geometry) GetLineString

func (x *Geometry) GetLineString() *LineString

func (*Geometry) GetMultiLineString

func (x *Geometry) GetMultiLineString() *MultiLineString

func (*Geometry) GetMultiPoint

func (x *Geometry) GetMultiPoint() *MultiPoint

func (*Geometry) GetMultiPolygon

func (x *Geometry) GetMultiPolygon() *MultiPolygon

func (*Geometry) GetPoint

func (x *Geometry) GetPoint() *Point

func (*Geometry) GetPolygon

func (x *Geometry) GetPolygon() *Polygon

func (*Geometry) GormDataType

func (x *Geometry) GormDataType() string

GormDataType gorm common data type

func (*Geometry) ProtoMessage

func (*Geometry) ProtoMessage()

func (*Geometry) ProtoReflect

func (x *Geometry) ProtoReflect() protoreflect.Message

func (*Geometry) Reset

func (x *Geometry) Reset()

func (*Geometry) Scan

func (x *Geometry) Scan(value interface{}) (err error)

func (*Geometry) SetValue

func (x *Geometry) SetValue(val interface{}) error

func (*Geometry) String

func (x *Geometry) String() string

func (*Geometry) ToWKB

func (x *Geometry) ToWKB() []byte

func (*Geometry) ToWKT

func (x *Geometry) ToWKT() string

func (*Geometry) Type

func (x *Geometry) Type() GeometryType

func (*Geometry) TypeString

func (x *Geometry) TypeString() string

func (*Geometry) Value

func (x *Geometry) Value() (driver.Value, error)

type GeometryCodec

type GeometryCodec struct {
}

func (*GeometryCodec) Decode

func (codec *GeometryCodec) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator)

func (*GeometryCodec) Encode

func (codec *GeometryCodec) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)

func (*GeometryCodec) IsEmpty

func (codec *GeometryCodec) IsEmpty(ptr unsafe.Pointer) bool

type GeometryCollection

type GeometryCollection struct {
	Type       string      `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	Geometries []*Geometry `protobuf:"bytes,5,rep,name=geometries,proto3" json:"geometries,omitempty"`
	// contains filtered or unexported fields
}

func NewGeometryCollection

func NewGeometryCollection(geometries ...*Geometry) *GeometryCollection

func (*GeometryCollection) AddGeometries

func (x *GeometryCollection) AddGeometries(geometries ...*Geometry)

func (*GeometryCollection) Descriptor deprecated

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

Deprecated: Use GeometryCollection.ProtoReflect.Descriptor instead.

func (*GeometryCollection) GetGeometries

func (x *GeometryCollection) GetGeometries() []*Geometry

func (*GeometryCollection) GetType

func (x *GeometryCollection) GetType() string

func (*GeometryCollection) ProtoMessage

func (*GeometryCollection) ProtoMessage()

func (*GeometryCollection) ProtoReflect

func (x *GeometryCollection) ProtoReflect() protoreflect.Message

func (*GeometryCollection) Reset

func (x *GeometryCollection) Reset()

func (*GeometryCollection) String

func (x *GeometryCollection) String() string

type GeometryCollectionCodec

type GeometryCollectionCodec struct {
}

func (*GeometryCollectionCodec) Decode

func (codec *GeometryCollectionCodec) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator)

func (*GeometryCollectionCodec) Encode

func (codec *GeometryCollectionCodec) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)

func (*GeometryCollectionCodec) IsEmpty

func (codec *GeometryCollectionCodec) IsEmpty(ptr unsafe.Pointer) bool

type GeometryType

type GeometryType int
const (
	UnknownType GeometryType = iota
	PointType
	MultiPointType
	LineStringType
	MultiLineStringType
	PolygonType
	MultiPolygonType
	GeometryCollectionType
)

type Geometry_GeometryCollection

type Geometry_GeometryCollection struct {
	GeometryCollection *GeometryCollection `protobuf:"bytes,7,opt,name=geometry_collection,json=geometryCollection,proto3,oneof" json:"geometryCollection,omitempty"`
}

type Geometry_LineString

type Geometry_LineString struct {
	LineString *LineString `protobuf:"bytes,3,opt,name=line_string,json=lineString,proto3,oneof" json:"lineString,omitempty"`
}

type Geometry_MultiLineString

type Geometry_MultiLineString struct {
	MultiLineString *MultiLineString `protobuf:"bytes,4,opt,name=multi_line_string,json=multiLineString,proto3,oneof" json:"multiLineString,omitempty"`
}

type Geometry_MultiPoint

type Geometry_MultiPoint struct {
	MultiPoint *MultiPoint `protobuf:"bytes,2,opt,name=multi_point,json=multiPoint,proto3,oneof" json:"multiPoint,omitempty"`
}

type Geometry_MultiPolygon

type Geometry_MultiPolygon struct {
	MultiPolygon *MultiPolygon `protobuf:"bytes,6,opt,name=multi_polygon,json=multiPolygon,proto3,oneof" json:"multiPolygon,omitempty"`
}

type Geometry_Point

type Geometry_Point struct {
	Point *Point `protobuf:"bytes,1,opt,name=point,proto3,oneof" json:"point,omitempty"`
}

type Geometry_Polygon

type Geometry_Polygon struct {
	Polygon *Polygon `protobuf:"bytes,5,opt,name=polygon,proto3,oneof" json:"polygon,omitempty"`
}

type Length

type Length float64

Length denotes a length on Earth

func EarthDistance

func EarthDistance(angle s1.Angle) Length

EarthDistance converts an angle to distance on earth in meters.

func (Length) String

func (l Length) String() string

String converts the length to human readable units

func (Length) Value

func (l Length) Value() float64

type LineString

type LineString struct {
	Type        string    `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	Coordinates []*LngLat `protobuf:"bytes,5,rep,name=coordinates,proto3" json:"coordinates,omitempty"`
	// contains filtered or unexported fields
}

func NewLineString

func NewLineString(coordinates ...*LngLat) *LineString

func NewLinearRing

func NewLinearRing(coordinates ...*LngLat) *LineString

NewLinearRing make sure LineString is a closed ring

func (*LineString) Add

func (x *LineString) Add(point *LngLat)

func (*LineString) Descriptor deprecated

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

Deprecated: Use LineString.ProtoReflect.Descriptor instead.

func (*LineString) GetCoordinates

func (x *LineString) GetCoordinates() []*LngLat

func (*LineString) GetType

func (x *LineString) GetType() string

func (*LineString) GormDBDataType

func (x *LineString) GormDBDataType(db *gorm.DB, field *schema.Field) string

GormDBDataType gorm db data type

func (*LineString) GormDataType

func (x *LineString) GormDataType() string

GormDataType gorm common data type

func (*LineString) ProtoMessage

func (*LineString) ProtoMessage()

func (*LineString) ProtoReflect

func (x *LineString) ProtoReflect() protoreflect.Message

func (*LineString) Reset

func (x *LineString) Reset()

func (*LineString) Scan

func (x *LineString) Scan(value interface{}) error

func (*LineString) String

func (x *LineString) String() string

func (*LineString) Value

func (x *LineString) Value() (driver.Value, error)

type LineStringCodec

type LineStringCodec struct {
}

func (*LineStringCodec) Decode

func (codec *LineStringCodec) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator)

func (*LineStringCodec) Encode

func (codec *LineStringCodec) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)

func (*LineStringCodec) IsEmpty

func (codec *LineStringCodec) IsEmpty(ptr unsafe.Pointer) bool

type LngLat

type LngLat struct {
	Longitude float64 `protobuf:"fixed64,1,opt,name=longitude,proto3" json:"longitude,omitempty"`
	Latitude  float64 `protobuf:"fixed64,2,opt,name=latitude,proto3" json:"latitude,omitempty"`
	Altitude  float64 `protobuf:"fixed64,3,opt,name=altitude,proto3" json:"altitude,omitempty"`
	// contains filtered or unexported fields
}

func BD09toGCJ02With

func BD09toGCJ02With(point *LngLat) *LngLat

func BD09toWGS84With

func BD09toWGS84With(point *LngLat) *LngLat

func CellCenter

func CellCenter(cid s2.CellID) *LngLat

func CellVertex

func CellVertex(cid s2.CellID, k int) *LngLat

func CellVertexes

func CellVertexes(cid s2.CellID) []*LngLat

func CellVertexesFromCell

func CellVertexesFromCell(cell s2.Cell) []*LngLat

func DecodeBinLngLat

func DecodeBinLngLat(coordinates ...int32) *LngLat

func GCJ02toBD09With

func GCJ02toBD09With(point *LngLat) *LngLat

func GCJ02toWGS84With

func GCJ02toWGS84With(point *LngLat) *LngLat

func GeoHashCenter

func GeoHashCenter(hash string) *LngLat

func GeoHashVertex

func GeoHashVertex(hash string, k int) *LngLat

func GeoHashVertexes

func GeoHashVertexes(hash string) []*LngLat

func NewLngLat

func NewLngLat(coordinates ...float64) *LngLat

func ParseLngLat

func ParseLngLat(lngLat string) (*LngLat, error)

func WGS84toBD09With

func WGS84toBD09With(point *LngLat) *LngLat

func WGS84toGCJ02With

func WGS84toGCJ02With(point *LngLat) *LngLat

func (*LngLat) BearingTo

func (x *LngLat) BearingTo(p2 *LngLat) float64

BearingTo Calculates the initial bearing (sometimes referred to as forward azimuth) Original Implementation from: http://www.movable-type.co.uk/scripts/latlong.html

func (*LngLat) CellID

func (x *LngLat) CellID() s2.CellID

func (*LngLat) CellIDWithLevel

func (x *LngLat) CellIDWithLevel(level int) s2.CellID

func (*LngLat) Descriptor deprecated

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

Deprecated: Use LngLat.ProtoReflect.Descriptor instead.

func (*LngLat) Distance

func (x *LngLat) Distance(point *LngLat) float64

Distance Calculates the Haversine distance between two points in meters.

func (*LngLat) Equal

func (x *LngLat) Equal(ll *LngLat) bool

func (*LngLat) Format

func (x *LngLat) Format() string

func (*LngLat) GeoHash

func (x *LngLat) GeoHash() string

func (*LngLat) GeoHashWithLevel

func (x *LngLat) GeoHashWithLevel(level int) string

func (*LngLat) GetAltitude

func (x *LngLat) GetAltitude() float64

func (*LngLat) GetLatitude

func (x *LngLat) GetLatitude() float64

func (*LngLat) GetLongitude

func (x *LngLat) GetLongitude() float64

func (*LngLat) GormDataType

func (x *LngLat) GormDataType() string

GormDataType gorm common data type

func (*LngLat) GreatCircleDistance

func (x *LngLat) GreatCircleDistance(p2 *LngLat) float64

GreatCircleDistance Calculates the Haversine distance between two points in meters. Original Implementation from: http://www.movable-type.co.uk/scripts/latlong.html

func (*LngLat) IsEmpty

func (x *LngLat) IsEmpty() bool

func (*LngLat) MidpointTo

func (x *LngLat) MidpointTo(p2 *LngLat) *LngLat

MidpointTo Calculates the midpoint between 'this' point and the supplied point. Original implementation from http://www.movable-type.co.uk/scripts/latlong.html

func (*LngLat) Parse

func (x *LngLat) Parse(value string) error

func (*LngLat) PointAtDistanceAndBearing

func (x *LngLat) PointAtDistanceAndBearing(dist float64, bearing float64) *LngLat

PointAtDistanceAndBearing returns a LngLat populated with the Latitude and Longitude coordinates by transposing the origin point the passed in distance (in meters) by the passed in compass bearing (in degrees). Original Implementation from: http://www.movable-type.co.uk/scripts/latlong.html

func (*LngLat) ProtoMessage

func (*LngLat) ProtoMessage()

func (*LngLat) ProtoReflect

func (x *LngLat) ProtoReflect() protoreflect.Message

func (*LngLat) Reset

func (x *LngLat) Reset()

func (*LngLat) Scan

func (x *LngLat) Scan(value interface{}) (err error)

func (*LngLat) String

func (x *LngLat) String() string

func (*LngLat) Value

func (x *LngLat) Value() (driver.Value, error)

type LngLatCodec

type LngLatCodec struct {
}

func (*LngLatCodec) Decode

func (codec *LngLatCodec) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator)

func (*LngLatCodec) IsEmpty

func (codec *LngLatCodec) IsEmpty(ptr unsafe.Pointer) bool

type MultiLineString

type MultiLineString struct {
	Type        string        `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	LineStrings []*LineString `protobuf:"bytes,5,rep,name=line_strings,json=lineStrings,proto3" json:"coordinates,omitempty"`
	// contains filtered or unexported fields
}

func NewMultiLineString

func NewMultiLineString(linestring ...*LineString) *MultiLineString

func NewMultiLineStringFrom

func NewMultiLineStringFrom(coordinates ...[]*LngLat) *MultiLineString

func (*MultiLineString) Descriptor deprecated

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

Deprecated: Use MultiLineString.ProtoReflect.Descriptor instead.

func (*MultiLineString) GetLineStrings

func (x *MultiLineString) GetLineStrings() []*LineString

func (*MultiLineString) GetType

func (x *MultiLineString) GetType() string

func (*MultiLineString) ProtoMessage

func (*MultiLineString) ProtoMessage()

func (*MultiLineString) ProtoReflect

func (x *MultiLineString) ProtoReflect() protoreflect.Message

func (*MultiLineString) Reset

func (x *MultiLineString) Reset()

func (*MultiLineString) String

func (x *MultiLineString) String() string

type MultiLineStringCodec

type MultiLineStringCodec struct {
}

func (*MultiLineStringCodec) Decode

func (codec *MultiLineStringCodec) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator)

func (*MultiLineStringCodec) Encode

func (codec *MultiLineStringCodec) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)

func (*MultiLineStringCodec) IsEmpty

func (codec *MultiLineStringCodec) IsEmpty(ptr unsafe.Pointer) bool

type MultiPoint

type MultiPoint struct {
	Type   string   `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	Points []*Point `protobuf:"bytes,5,rep,name=points,proto3" json:"coordinates,omitempty"`
	// contains filtered or unexported fields
}

func NewMultiPoint

func NewMultiPoint(points ...*Point) *MultiPoint

func NewMultiPointFrom

func NewMultiPointFrom(points ...*LngLat) *MultiPoint

func (*MultiPoint) Descriptor deprecated

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

Deprecated: Use MultiPoint.ProtoReflect.Descriptor instead.

func (*MultiPoint) GetLngLats

func (x *MultiPoint) GetLngLats() []*LngLat

func (*MultiPoint) GetPoints

func (x *MultiPoint) GetPoints() []*Point

func (*MultiPoint) GetType

func (x *MultiPoint) GetType() string

func (*MultiPoint) ProtoMessage

func (*MultiPoint) ProtoMessage()

func (*MultiPoint) ProtoReflect

func (x *MultiPoint) ProtoReflect() protoreflect.Message

func (*MultiPoint) Reset

func (x *MultiPoint) Reset()

func (*MultiPoint) String

func (x *MultiPoint) String() string

type MultiPointCodec

type MultiPointCodec struct {
}

func (*MultiPointCodec) Decode

func (codec *MultiPointCodec) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator)

func (*MultiPointCodec) Encode

func (codec *MultiPointCodec) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)

func (*MultiPointCodec) IsEmpty

func (codec *MultiPointCodec) IsEmpty(ptr unsafe.Pointer) bool

type MultiPolygon

type MultiPolygon struct {
	Type     string     `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	Polygons []*Polygon `protobuf:"bytes,5,rep,name=polygons,proto3" json:"coordinates,omitempty"`
	// contains filtered or unexported fields
}

func NewMultiPolygon

func NewMultiPolygon(coordinates ...*Polygon) *MultiPolygon

func (*MultiPolygon) CellCovering

func (x *MultiPolygon) CellCovering(minLevel, maxLevel, maxCells int) s2.CellUnion

func (*MultiPolygon) Contains

func (x *MultiPolygon) Contains(point *LngLat) bool

func (*MultiPolygon) Descriptor deprecated

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

Deprecated: Use MultiPolygon.ProtoReflect.Descriptor instead.

func (*MultiPolygon) GeoHashCovering

func (x *MultiPolygon) GeoHashCovering(minLevel, maxLevel, maxHashes int) []string

func (*MultiPolygon) GetPolygons

func (x *MultiPolygon) GetPolygons() []*Polygon

func (*MultiPolygon) GetType

func (x *MultiPolygon) GetType() string

func (*MultiPolygon) Invert

func (x *MultiPolygon) Invert()

func (*MultiPolygon) ProtoMessage

func (*MultiPolygon) ProtoMessage()

func (*MultiPolygon) ProtoReflect

func (x *MultiPolygon) ProtoReflect() protoreflect.Message

func (*MultiPolygon) Reset

func (x *MultiPolygon) Reset()

func (*MultiPolygon) String

func (x *MultiPolygon) String() string

type MultiPolygonCodec

type MultiPolygonCodec struct {
}

func (*MultiPolygonCodec) Decode

func (codec *MultiPolygonCodec) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator)

func (*MultiPolygonCodec) Encode

func (codec *MultiPolygonCodec) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)

func (*MultiPolygonCodec) IsEmpty

func (codec *MultiPolygonCodec) IsEmpty(ptr unsafe.Pointer) bool

type Point

type Point struct {
	Type       string  `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	Coordinate *LngLat `protobuf:"bytes,5,opt,name=coordinate,proto3" json:"coordinates,omitempty"`
	// contains filtered or unexported fields
}

func NewPoint

func NewPoint(coordinate *LngLat) *Point

func NewPointFrom

func NewPointFrom(coordinates ...float64) *Point

func (*Point) CellCovering

func (x *Point) CellCovering(minLevel, maxLevel, maxCells int) s2.CellUnion

func (*Point) Descriptor deprecated

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

Deprecated: Use Point.ProtoReflect.Descriptor instead.

func (*Point) GeoHashCovering

func (x *Point) GeoHashCovering(minLevel, maxLevel, maxHashes int) []string

func (*Point) GetAltitude

func (x *Point) GetAltitude() float64

func (*Point) GetCoordinate

func (x *Point) GetCoordinate() *LngLat

func (*Point) GetLatitude

func (x *Point) GetLatitude() float64

func (*Point) GetLongitude

func (x *Point) GetLongitude() float64

func (*Point) GetType

func (x *Point) GetType() string

func (*Point) ProtoMessage

func (*Point) ProtoMessage()

func (*Point) ProtoReflect

func (x *Point) ProtoReflect() protoreflect.Message

func (*Point) Reset

func (x *Point) Reset()

func (*Point) String

func (x *Point) String() string

type PointCodec

type PointCodec struct {
}

func (*PointCodec) Decode

func (codec *PointCodec) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator)

func (*PointCodec) Encode

func (codec *PointCodec) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)

func (*PointCodec) IsEmpty

func (codec *PointCodec) IsEmpty(ptr unsafe.Pointer) bool

type Polygon

type Polygon struct {
	Type        string        `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	LineStrings []*LineString `protobuf:"bytes,5,rep,name=line_strings,json=lineStrings,proto3" json:"coordinates,omitempty"`
	// contains filtered or unexported fields
}

func NewPolygon

func NewPolygon(lineStrings ...*LineString) *Polygon

func NewPolygonFrom

func NewPolygonFrom(coordinates ...*LngLat) *Polygon

func NewPolygonFromCell

func NewPolygonFromCell(cell s2.Cell) *Polygon

func NewPolygonFromCellID

func NewPolygonFromCellID(cid s2.CellID) *Polygon

func NewPolygonFromGeoHash

func NewPolygonFromGeoHash(geohash string) *Polygon

func (*Polygon) Add

func (x *Polygon) Add(point *LngLat) *Polygon

Add Appends the passed in contour to the current Polygon. Notice: point is add to first LineString of the Polygon.

func (*Polygon) Area

func (x *Polygon) Area() float64

Area Assumption: The holes are not intersected with each other.

func (*Polygon) CellCovering

func (x *Polygon) CellCovering(minLevel, maxLevel, maxCells int) s2.CellUnion

CellCovering Notice: Holes in polygon are covered too!

func (*Polygon) CellCoveringExceptHoles

func (x *Polygon) CellCoveringExceptHoles(minLevel, maxLevel, maxCells int) s2.CellUnion

CellCoveringExceptHoles Notice: Holes in polygon are not covered!

func (*Polygon) Contains

func (x *Polygon) Contains(point *LngLat) bool

Contains returns whether the current Polygon contains the passed in Point. If the Point is contained by only one LineString, it's contained by the Polygon.

func (*Polygon) Descriptor deprecated

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

Deprecated: Use Polygon.ProtoReflect.Descriptor instead.

func (*Polygon) GeoHashCovering

func (x *Polygon) GeoHashCovering(minLevel, maxLevel, maxHashes int) []string

func (*Polygon) GeoHashFractionCovering

func (x *Polygon) GeoHashFractionCovering(minLevel, maxLevel, maxHashes int, fraction float32) []string

func (*Polygon) GetLineStrings

func (x *Polygon) GetLineStrings() []*LineString

func (*Polygon) GetType

func (x *Polygon) GetType() string

func (*Polygon) GormDataType

func (x *Polygon) GormDataType() string

GormDataType gorm common data type

func (*Polygon) Invert

func (x *Polygon) Invert()

Invert all LineStrings in the Polygon.

func (*Polygon) IsClosed

func (x *Polygon) IsClosed() bool

IsClosed returns whether or not the polygon is closed. TODO: This can obviously be improved, but for now,

this should be sufficient for detecting if points
are contained using the raycast algorithm.

func (*Polygon) ProtoMessage

func (*Polygon) ProtoMessage()

func (*Polygon) ProtoReflect

func (x *Polygon) ProtoReflect() protoreflect.Message

func (*Polygon) Reset

func (x *Polygon) Reset()

func (*Polygon) Scan

func (x *Polygon) Scan(value interface{}) error

func (*Polygon) String

func (x *Polygon) String() string

func (*Polygon) Value

func (x *Polygon) Value() (driver.Value, error)

type PolygonCodec

type PolygonCodec struct {
}

func (*PolygonCodec) Decode

func (codec *PolygonCodec) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator)

func (*PolygonCodec) Encode

func (codec *PolygonCodec) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)

func (*PolygonCodec) IsEmpty

func (codec *PolygonCodec) IsEmpty(ptr unsafe.Pointer) bool

type SpatialReference

type SpatialReference int32
const (
	SpatialReference_SPATIAL_REFERENCE_UNSPECIFIED SpatialReference = 0
	SpatialReference_SPATIAL_REFERENCE_WGS84       SpatialReference = 1
	SpatialReference_SPATIAL_REFERENCE_GCJ02       SpatialReference = 2
	SpatialReference_SPATIAL_REFERENCE_BD09        SpatialReference = 3
	SpatialReference_SPATIAL_REFERENCE_CGCS2000    SpatialReference = 4
	SpatialReference_SPATIAL_REFERENCE_SH2000      SpatialReference = 5
)

func ParseSpatialReference

func ParseSpatialReference(value string) (SpatialReference, error)

func (SpatialReference) Descriptor

func (SpatialReference) Enum

func (SpatialReference) EnumDescriptor deprecated

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

Deprecated: Use SpatialReference.Descriptor instead.

func (SpatialReference) Format

func (x SpatialReference) Format() string

func (SpatialReference) Number

func (*SpatialReference) Parse

func (x *SpatialReference) Parse(value string) error

func (SpatialReference) String

func (x SpatialReference) String() string

func (SpatialReference) ToString

func (x SpatialReference) ToString() string

func (SpatialReference) Type

type SpatialReferenceCodec

type SpatialReferenceCodec struct {
}

func (*SpatialReferenceCodec) Decode

func (codec *SpatialReferenceCodec) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator)

func (*SpatialReferenceCodec) Encode

func (codec *SpatialReferenceCodec) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)

func (*SpatialReferenceCodec) IsEmpty

func (codec *SpatialReferenceCodec) IsEmpty(ptr unsafe.Pointer) bool

type WKB

type WKB struct {
}

func (*WKB) Decode

func (w *WKB) Decode(wkb []byte) (*Geometry, error)

func (*WKB) Encode

func (w *WKB) Encode(geometry *Geometry) []byte

type WKT

type WKT struct {
}

func (*WKT) Decode

func (w *WKT) Decode(wkt string) (*Geometry, error)

func (*WKT) Encode

func (w *WKT) Encode(geometry *Geometry) string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL