Documentation ¶
Index ¶
- Constants
- Variables
- func BD09toGCJ02(lon, lat float64) (float64, float64)
- func BD09toWGS84(lon, lat float64) (float64, float64)
- func CellTokens(cells s2.CellUnion) [][]byte
- func Distance(lng1, lat1, lng2, lat2 float64) float64
- func DistanceBetween(pt1 *LngLat, pt2 *LngLat) float64
- func EarthAngle(dist float64) s1.Angle
- func EncodeBinLngLat(point *LngLat) []int32
- func GCJ02toBD09(lon, lat float64) (float64, float64)
- func GCJ02toWGS84(lon, lat float64) (float64, float64)
- func LatLngToDegrees(latLng s2.LatLng) s2.LatLng
- func WGS84toBD09(lon, lat float64) (float64, float64)
- func WGS84toGCJ02(lon, lat float64) (float64, float64)
- type Area
- type BinLngLat
- func (x *BinLngLat) Decode() *LngLat
- func (*BinLngLat) Descriptor() ([]byte, []int)deprecated
- func (x *BinLngLat) Encode(lnglat *LngLat) *BinLngLat
- func (x *BinLngLat) GetAltitude() int32
- func (x *BinLngLat) GetLatitude() int32
- func (x *BinLngLat) GetLongitude() int32
- func (*BinLngLat) ProtoMessage()
- func (x *BinLngLat) ProtoReflect() protoreflect.Message
- func (x *BinLngLat) Reset()
- func (x *BinLngLat) String() string
- type BoundingBox
- func (*BoundingBox) Descriptor() ([]byte, []int)deprecated
- func (x *BoundingBox) Extend(box *BoundingBox) *BoundingBox
- func (x *BoundingBox) ExtendDegree(lng float64, lat float64) *BoundingBox
- func (x *BoundingBox) GeoHashCovering(minLevel, maxLevel, maxHashes int) []string
- func (x *BoundingBox) GetLeftBottom() *LngLat
- func (x *BoundingBox) GetRightTop() *LngLat
- func (*BoundingBox) ProtoMessage()
- func (x *BoundingBox) ProtoReflect() protoreflect.Message
- func (x *BoundingBox) Reset()
- func (x *BoundingBox) String() string
- func (x *BoundingBox) Vertex(index int) *LngLat
- func (x *BoundingBox) Vertexes() []*LngLat
- type Circle
- func (x *Circle) CellCovering(minLevel, maxLevel, maxCells int) s2.CellUnion
- func (*Circle) Descriptor() ([]byte, []int)deprecated
- func (x *Circle) GeoHashCovering(minLevel, maxLevel, maxHashes int) []string
- func (x *Circle) GeoHashFractionCovering(minLevel, maxLevel, maxHashes int, fraction float32) []string
- func (x *Circle) GetCenter() *LngLat
- func (x *Circle) GetRadius() float32
- func (x *Circle) GetType() string
- func (*Circle) ProtoMessage()
- func (x *Circle) ProtoReflect() protoreflect.Message
- func (x *Circle) Reset()
- func (x *Circle) Scan(src interface{}) error
- func (x *Circle) String() string
- func (x *Circle) ToPolygon(numberOfSegments int) *Polygon
- func (x *Circle) Value() (driver.Value, error)
- type Feature
- func (*Feature) Descriptor() ([]byte, []int)deprecated
- func (x *Feature) GetBbox() *BoundingBox
- func (x *Feature) GetBoolProperty(key string) (bool, error)
- func (x *Feature) GetDoubleProperty(key string) (float64, error)
- func (x *Feature) GetFloat64Property(key string) (float64, error)
- func (x *Feature) GetGeometry() *Geometry
- func (x *Feature) GetId() *core.Id
- func (x *Feature) GetIntProperty(key string) (int64, error)
- func (x *Feature) GetLineString() *LineString
- func (x *Feature) GetPoint() *Point
- func (x *Feature) GetPolygon() *Polygon
- func (x *Feature) GetProperties() map[string]*core.Value
- func (x *Feature) GetProperty(key string) (*core.Value, error)
- func (x *Feature) GetSpatialReference() SpatialReference
- func (x *Feature) GetStringProperty(key string) (string, error)
- func (x *Feature) GetType() string
- func (*Feature) ProtoMessage()
- func (x *Feature) ProtoReflect() protoreflect.Message
- func (x *Feature) Reset()
- func (x *Feature) SetBool(key string, val bool) *Feature
- func (x *Feature) SetDouble(key string, val float64) *Feature
- func (x *Feature) SetInt64(key string, val int64) *Feature
- func (x *Feature) SetIntId(id uint64)
- func (x *Feature) SetProperty(key string, val *core.Value) *Feature
- func (x *Feature) SetString(key string, val string) *Feature
- func (x *Feature) SetStringId(id string)
- func (x *Feature) String() string
- type FeatureCodec
- type FeatureCollection
- func (x *FeatureCollection) AddFeatures(features ...*Feature)
- func (*FeatureCollection) Descriptor() ([]byte, []int)deprecated
- func (x *FeatureCollection) GetFeatures() []*Feature
- func (x *FeatureCollection) GetKeys() []string
- func (x *FeatureCollection) GetType() string
- func (x *FeatureCollection) GetValues() []*core.Value
- func (*FeatureCollection) ProtoMessage()
- func (x *FeatureCollection) ProtoReflect() protoreflect.Message
- func (x *FeatureCollection) Reset()
- func (x *FeatureCollection) String() string
- type FeatureCollectionCodec
- type GeoJson
- func NewFeatureCollectionGeoJson(features ...*Feature) *GeoJson
- func NewGeoJson(data interface{}) *GeoJson
- func NewLineStringGeoJson(coordinates ...*LngLat) *GeoJson
- func NewPointGeoJson(coordinates *LngLat) *GeoJson
- func NewPointGeoJsonFrom(coordinates ...float64) *GeoJson
- func NewPolygonGeoJson(lineStrings ...*LineString) *GeoJson
- func NewPolygonGeoJsonFrom(coordinates ...*LngLat) *GeoJson
- func (*GeoJson) Descriptor() ([]byte, []int)deprecated
- func (x *GeoJson) GetFeature() *Feature
- func (x *GeoJson) GetFeatureCollection() *FeatureCollection
- func (m *GeoJson) GetGeoJson() isGeoJson_GeoJson
- func (x *GeoJson) GetGeometryCollection() *GeometryCollection
- func (x *GeoJson) GetLineString() *LineString
- func (x *GeoJson) GetMultiLineString() *MultiLineString
- func (x *GeoJson) GetMultiPoint() *MultiPoint
- func (x *GeoJson) GetMultiPolygon() *MultiPolygon
- func (x *GeoJson) GetPoint() *Point
- func (x *GeoJson) GetPolygon() *Polygon
- func (*GeoJson) ProtoMessage()
- func (x *GeoJson) ProtoReflect() protoreflect.Message
- func (x *GeoJson) Reset()
- func (x *GeoJson) String() string
- type GeoJsonCodec
- type GeoJson_Feature
- type GeoJson_FeatureCollection
- type GeoJson_GeometryCollection
- type GeoJson_LineString
- type GeoJson_MultiLineString
- type GeoJson_MultiPoint
- type GeoJson_MultiPolygon
- type GeoJson_Point
- type GeoJson_Polygon
- type Geometry
- func CellToPolygon(cid s2.CellID) *Geometry
- func NewGeometry(val interface{}) *Geometry
- func NewGeometryCollectionGeometry(geometries ...*Geometry) *Geometry
- func NewGeometryFromWKB(wkb []byte) (*Geometry, error)
- func NewGeometryFromWKT(wkt string) (*Geometry, error)
- func NewLineStringGeometry(coordinates ...*LngLat) *Geometry
- func NewMultiLineStringGeometry(lineStrings ...*LineString) *Geometry
- func NewMultiLineStringGeometryFrom(coordinates ...[]*LngLat) *Geometry
- func NewMultiPointGeometry(points ...*Point) *Geometry
- func NewMultiPointGeometryFrom(points ...*LngLat) *Geometry
- func NewMultiPolygonGeometry(p ...*Polygon) *Geometry
- func NewPointGeometry(ll *LngLat) *Geometry
- func NewPointGeometryFrom(coordinates ...float64) *Geometry
- func NewPolygonGeometry(lineStrings ...*LineString) *Geometry
- func NewPolygonGeometryFrom(coordinates ...*LngLat) *Geometry
- func (*Geometry) Descriptor() ([]byte, []int)deprecated
- func (x *Geometry) FromWKB(wkb []byte) error
- func (x *Geometry) FromWKT(wkt string) error
- func (m *Geometry) GetGeometry() isGeometry_Geometry
- func (x *Geometry) GetGeometryCollection() *GeometryCollection
- func (x *Geometry) GetLineString() *LineString
- func (x *Geometry) GetMultiLineString() *MultiLineString
- func (x *Geometry) GetMultiPoint() *MultiPoint
- func (x *Geometry) GetMultiPolygon() *MultiPolygon
- func (x *Geometry) GetPoint() *Point
- func (x *Geometry) GetPolygon() *Polygon
- func (x *Geometry) GormDataType() string
- func (*Geometry) ProtoMessage()
- func (x *Geometry) ProtoReflect() protoreflect.Message
- func (x *Geometry) Reset()
- func (x *Geometry) Scan(value interface{}) (err error)
- func (x *Geometry) SetValue(val interface{}) error
- func (x *Geometry) String() string
- func (x *Geometry) ToWKB() []byte
- func (x *Geometry) ToWKT() string
- func (x *Geometry) Type() GeometryType
- func (x *Geometry) TypeString() string
- func (x *Geometry) Value() (driver.Value, error)
- type GeometryCodec
- type GeometryCollection
- func (x *GeometryCollection) AddGeometries(geometries ...*Geometry)
- func (*GeometryCollection) Descriptor() ([]byte, []int)deprecated
- func (x *GeometryCollection) GetGeometries() []*Geometry
- func (x *GeometryCollection) GetType() string
- func (*GeometryCollection) ProtoMessage()
- func (x *GeometryCollection) ProtoReflect() protoreflect.Message
- func (x *GeometryCollection) Reset()
- func (x *GeometryCollection) String() string
- type GeometryCollectionCodec
- type GeometryType
- type Geometry_GeometryCollection
- type Geometry_LineString
- type Geometry_MultiLineString
- type Geometry_MultiPoint
- type Geometry_MultiPolygon
- type Geometry_Point
- type Geometry_Polygon
- type Length
- type LineString
- func (x *LineString) Add(point *LngLat)
- func (*LineString) Descriptor() ([]byte, []int)deprecated
- func (x *LineString) GetCoordinates() []*LngLat
- func (x *LineString) GetType() string
- func (x *LineString) GormDBDataType(db *gorm.DB, field *schema.Field) string
- func (x *LineString) GormDataType() string
- func (*LineString) ProtoMessage()
- func (x *LineString) ProtoReflect() protoreflect.Message
- func (x *LineString) Reset()
- func (x *LineString) Scan(value interface{}) error
- func (x *LineString) String() string
- func (x *LineString) Value() (driver.Value, error)
- type LineStringCodec
- type LngLat
- func BD09toGCJ02With(point *LngLat) *LngLat
- func BD09toWGS84With(point *LngLat) *LngLat
- func CellCenter(cid s2.CellID) *LngLat
- func CellVertex(cid s2.CellID, k int) *LngLat
- func CellVertexes(cid s2.CellID) []*LngLat
- func CellVertexesFromCell(cell s2.Cell) []*LngLat
- func DecodeBinLngLat(coordinates ...int32) *LngLat
- func GCJ02toBD09With(point *LngLat) *LngLat
- func GCJ02toWGS84With(point *LngLat) *LngLat
- func GeoHashCenter(hash string) *LngLat
- func GeoHashVertex(hash string, k int) *LngLat
- func GeoHashVertexes(hash string) []*LngLat
- func NewLngLat(coordinates ...float64) *LngLat
- func ParseLngLat(lngLat string) (*LngLat, error)
- func WGS84toBD09With(point *LngLat) *LngLat
- func WGS84toGCJ02With(point *LngLat) *LngLat
- func (x *LngLat) BearingTo(p2 *LngLat) float64
- func (x *LngLat) CellID() s2.CellID
- func (x *LngLat) CellIDWithLevel(level int) s2.CellID
- func (*LngLat) Descriptor() ([]byte, []int)deprecated
- func (x *LngLat) Distance(point *LngLat) float64
- func (x *LngLat) Equal(ll *LngLat) bool
- func (x *LngLat) Format() string
- func (x *LngLat) GeoHash() string
- func (x *LngLat) GeoHashWithLevel(level int) string
- func (x *LngLat) GetAltitude() float64
- func (x *LngLat) GetLatitude() float64
- func (x *LngLat) GetLongitude() float64
- func (x *LngLat) GormDataType() string
- func (x *LngLat) GreatCircleDistance(p2 *LngLat) float64
- func (x *LngLat) IsEmpty() bool
- func (x *LngLat) MidpointTo(p2 *LngLat) *LngLat
- func (x *LngLat) Parse(value string) error
- func (x *LngLat) PointAtDistanceAndBearing(dist float64, bearing float64) *LngLat
- func (*LngLat) ProtoMessage()
- func (x *LngLat) ProtoReflect() protoreflect.Message
- func (x *LngLat) Reset()
- func (x *LngLat) Scan(value interface{}) (err error)
- func (x *LngLat) String() string
- func (x *LngLat) Value() (driver.Value, error)
- type LngLatCodec
- type MultiLineString
- func (*MultiLineString) Descriptor() ([]byte, []int)deprecated
- func (x *MultiLineString) GetLineStrings() []*LineString
- func (x *MultiLineString) GetType() string
- func (*MultiLineString) ProtoMessage()
- func (x *MultiLineString) ProtoReflect() protoreflect.Message
- func (x *MultiLineString) Reset()
- func (x *MultiLineString) String() string
- type MultiLineStringCodec
- type MultiPoint
- func (*MultiPoint) Descriptor() ([]byte, []int)deprecated
- func (x *MultiPoint) GetLngLats() []*LngLat
- func (x *MultiPoint) GetPoints() []*Point
- func (x *MultiPoint) GetType() string
- func (*MultiPoint) ProtoMessage()
- func (x *MultiPoint) ProtoReflect() protoreflect.Message
- func (x *MultiPoint) Reset()
- func (x *MultiPoint) String() string
- type MultiPointCodec
- type MultiPolygon
- func (x *MultiPolygon) CellCovering(minLevel, maxLevel, maxCells int) s2.CellUnion
- func (x *MultiPolygon) Contains(point *LngLat) bool
- func (*MultiPolygon) Descriptor() ([]byte, []int)deprecated
- func (x *MultiPolygon) GeoHashCovering(minLevel, maxLevel, maxHashes int) []string
- func (x *MultiPolygon) GetPolygons() []*Polygon
- func (x *MultiPolygon) GetType() string
- func (x *MultiPolygon) Invert()
- func (*MultiPolygon) ProtoMessage()
- func (x *MultiPolygon) ProtoReflect() protoreflect.Message
- func (x *MultiPolygon) Reset()
- func (x *MultiPolygon) String() string
- type MultiPolygonCodec
- type Point
- func (x *Point) CellCovering(minLevel, maxLevel, maxCells int) s2.CellUnion
- func (*Point) Descriptor() ([]byte, []int)deprecated
- func (x *Point) GeoHashCovering(minLevel, maxLevel, maxHashes int) []string
- func (x *Point) GetAltitude() float64
- func (x *Point) GetCoordinate() *LngLat
- func (x *Point) GetLatitude() float64
- func (x *Point) GetLongitude() float64
- func (x *Point) GetType() string
- func (*Point) ProtoMessage()
- func (x *Point) ProtoReflect() protoreflect.Message
- func (x *Point) Reset()
- func (x *Point) String() string
- type PointCodec
- type Polygon
- func (x *Polygon) Add(point *LngLat) *Polygon
- func (x *Polygon) Area() float64
- func (x *Polygon) CellCovering(minLevel, maxLevel, maxCells int) s2.CellUnion
- func (x *Polygon) CellCoveringExceptHoles(minLevel, maxLevel, maxCells int) s2.CellUnion
- func (x *Polygon) Contains(point *LngLat) bool
- func (*Polygon) Descriptor() ([]byte, []int)deprecated
- func (x *Polygon) GeoHashCovering(minLevel, maxLevel, maxHashes int) []string
- func (x *Polygon) GeoHashFractionCovering(minLevel, maxLevel, maxHashes int, fraction float32) []string
- func (x *Polygon) GetLineStrings() []*LineString
- func (x *Polygon) GetType() string
- func (x *Polygon) GormDataType() string
- func (x *Polygon) Invert()
- func (x *Polygon) IsClosed() bool
- func (*Polygon) ProtoMessage()
- func (x *Polygon) ProtoReflect() protoreflect.Message
- func (x *Polygon) Reset()
- func (x *Polygon) Scan(value interface{}) error
- func (x *Polygon) String() string
- func (x *Polygon) Value() (driver.Value, error)
- type PolygonCodec
- type SpatialReference
- func (SpatialReference) Descriptor() protoreflect.EnumDescriptor
- func (x SpatialReference) Enum() *SpatialReference
- func (SpatialReference) EnumDescriptor() ([]byte, []int)deprecated
- func (x SpatialReference) Format() string
- func (x SpatialReference) Number() protoreflect.EnumNumber
- func (x *SpatialReference) Parse(value string) error
- func (x SpatialReference) String() string
- func (x SpatialReference) ToString() string
- func (SpatialReference) Type() protoreflect.EnumType
- type SpatialReferenceCodec
- type WKB
- type WKT
Constants ¶
const ( E7 = 10000000.0 E2 = 100.0 )
const ( XPI = math.Pi * 3000.0 / 180.0 OFFSET = 0.00669342162296594323 AXIS = 6378245.0 )
const ( WKBPoint uint32 = 1 WKBLineString uint32 = 2 WKBPolygon uint32 = 3 WKBMultiPoint uint32 = 4 WKBMultiLineString uint32 = 5 WKBMultiPolygon uint32 = 6 WKBGeometryCollection uint32 = 7 )
const (
// EarthRadius According to Wikipedia, the Earth's radius is about 6,371,004 m
EarthRadius = 6371000
)
const EarthRadiusMeters = 1000 * 6371
const Empty = "EMPTY"
Variables ¶
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.
var File_mojo_geom_bin_lng_lat_proto protoreflect.FileDescriptor
var File_mojo_geom_bounding_box_proto protoreflect.FileDescriptor
var File_mojo_geom_circle_proto protoreflect.FileDescriptor
var File_mojo_geom_feature_collection_proto protoreflect.FileDescriptor
var File_mojo_geom_feature_proto protoreflect.FileDescriptor
var File_mojo_geom_geo_json_proto protoreflect.FileDescriptor
var File_mojo_geom_geom_proto protoreflect.FileDescriptor
var File_mojo_geom_line_string_proto protoreflect.FileDescriptor
var File_mojo_geom_lng_lat_proto protoreflect.FileDescriptor
var File_mojo_geom_multi_line_string_proto protoreflect.FileDescriptor
var File_mojo_geom_multi_point_proto protoreflect.FileDescriptor
var File_mojo_geom_multi_polygon_proto protoreflect.FileDescriptor
var File_mojo_geom_point_proto protoreflect.FileDescriptor
var File_mojo_geom_polygon_proto protoreflect.FileDescriptor
var File_mojo_geom_spatial_reference_proto protoreflect.FileDescriptor
var SpatialReferenceNames = map[int32]string{
0: "unspecified",
1: "wgs84",
2: "gcj02",
3: "bd09",
4: "cgcs2000",
5: "sh2000",
}
var SpatialReferenceValues = map[string]SpatialReference{ "unspecified": SpatialReference_SPATIAL_REFERENCE_UNSPECIFIED, "wgs84": SpatialReference_SPATIAL_REFERENCE_WGS84, "gcj02": SpatialReference_SPATIAL_REFERENCE_GCJ02, "bd09": SpatialReference_SPATIAL_REFERENCE_BD09, "cgcs2000": SpatialReference_SPATIAL_REFERENCE_CGCS2000, "sh2000": SpatialReference_SPATIAL_REFERENCE_SH2000, }
Functions ¶
func BD09toWGS84 ¶
BD09toWGS84 百度坐标系->WGS84坐标系
func CellTokens ¶
func Distance ¶
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 EarthAngle ¶
EarthAngle converts a to distance on earth in meters to an angle
func EncodeBinLngLat ¶
func GCJ02toWGS84 ¶
GCJ02toWGS84 火星坐标系->WGS84坐标系
func WGS84toBD09 ¶
WGS84toBD09 WGS84坐标系->百度坐标系
func WGS84toGCJ02 ¶
WGS84toGCJ02 WGS84坐标系->火星坐标系
Types ¶
type Area ¶
type Area float64
Area denotes an area on Earth
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 NewBinLngLatWith ¶
func (*BinLngLat) Descriptor
deprecated
func (*BinLngLat) GetAltitude ¶
func (*BinLngLat) GetLatitude ¶
func (*BinLngLat) GetLongitude ¶
func (*BinLngLat) ProtoMessage ¶
func (*BinLngLat) ProtoMessage()
func (*BinLngLat) ProtoReflect ¶
func (x *BinLngLat) ProtoReflect() protoreflect.Message
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 (*Circle) Descriptor
deprecated
func (*Circle) GeoHashCovering ¶
func (*Circle) GeoHashFractionCovering ¶
func (*Circle) ProtoMessage ¶
func (*Circle) ProtoMessage()
func (*Circle) ProtoReflect ¶
func (x *Circle) ProtoReflect() protoreflect.Message
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 NewLineStringFeature ¶
func NewPointFeature ¶
func NewPointFeatureFrom ¶
func NewPolygonFeatureFrom ¶
func (*Feature) Descriptor
deprecated
func (*Feature) GetBbox ¶
func (x *Feature) GetBbox() *BoundingBox
func (*Feature) GetDoubleProperty ¶
func (*Feature) GetFloat64Property ¶
func (*Feature) GetGeometry ¶
func (*Feature) GetLineString ¶
func (x *Feature) GetLineString() *LineString
func (*Feature) GetPolygon ¶
func (*Feature) GetSpatialReference ¶
func (x *Feature) GetSpatialReference() SpatialReference
func (*Feature) ProtoMessage ¶
func (*Feature) ProtoMessage()
func (*Feature) ProtoReflect ¶
func (x *Feature) ProtoReflect() protoreflect.Message
func (*Feature) SetStringId ¶
type FeatureCodec ¶
type FeatureCodec struct { }
func (*FeatureCodec) Decode ¶
func (codec *FeatureCodec) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator)
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)
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 NewGeoJson ¶
func NewGeoJson(data interface{}) *GeoJson
func NewLineStringGeoJson ¶
func NewPointGeoJson ¶
func NewPointGeoJsonFrom ¶
func NewPolygonGeoJson ¶
func NewPolygonGeoJson(lineStrings ...*LineString) *GeoJson
func NewPolygonGeoJsonFrom ¶
func (*GeoJson) Descriptor
deprecated
func (*GeoJson) GetFeature ¶
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) GetPolygon ¶
func (*GeoJson) ProtoMessage ¶
func (*GeoJson) ProtoMessage()
func (*GeoJson) ProtoReflect ¶
func (x *GeoJson) ProtoReflect() protoreflect.Message
type GeoJsonCodec ¶
type GeoJsonCodec struct { }
func (*GeoJsonCodec) Decode ¶
func (codec *GeoJsonCodec) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator)
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 NewGeometry ¶
func NewGeometry(val interface{}) *Geometry
func NewGeometryFromWKB ¶
func NewGeometryFromWKT ¶
func NewLineStringGeometry ¶
func NewMultiLineStringGeometry ¶
func NewMultiLineStringGeometry(lineStrings ...*LineString) *Geometry
func NewMultiPointGeometry ¶
func NewMultiPolygonGeometry ¶
func NewPointGeometry ¶
func NewPointGeometryFrom ¶
func NewPolygonGeometry ¶
func NewPolygonGeometry(lineStrings ...*LineString) *Geometry
func NewPolygonGeometryFrom ¶
func (*Geometry) Descriptor
deprecated
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) GetPolygon ¶
func (*Geometry) GormDataType ¶
GormDataType gorm common data type
func (*Geometry) ProtoMessage ¶
func (*Geometry) ProtoMessage()
func (*Geometry) ProtoReflect ¶
func (x *Geometry) ProtoReflect() protoreflect.Message
func (*Geometry) Type ¶
func (x *Geometry) Type() GeometryType
func (*Geometry) TypeString ¶
type GeometryCodec ¶
type GeometryCodec struct { }
func (*GeometryCodec) Decode ¶
func (codec *GeometryCodec) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator)
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)
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 ¶
EarthDistance converts an angle to distance on earth in meters.
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 ¶
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
type LineStringCodec ¶
type LineStringCodec struct { }
func (*LineStringCodec) Decode ¶
func (codec *LineStringCodec) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator)
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 BD09toWGS84With ¶
func CellCenter ¶
func CellVertexes ¶
func CellVertexesFromCell ¶
func DecodeBinLngLat ¶
func GCJ02toBD09With ¶
func GCJ02toWGS84With ¶
func GeoHashCenter ¶
func GeoHashVertex ¶
func GeoHashVertexes ¶
func ParseLngLat ¶
func WGS84toBD09With ¶
func WGS84toGCJ02With ¶
func (*LngLat) BearingTo ¶
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) Descriptor
deprecated
func (*LngLat) GeoHashWithLevel ¶
func (*LngLat) GetAltitude ¶
func (*LngLat) GetLatitude ¶
func (*LngLat) GetLongitude ¶
func (*LngLat) GormDataType ¶
GormDataType gorm common data type
func (*LngLat) GreatCircleDistance ¶
GreatCircleDistance Calculates the Haversine distance between two points in meters. Original Implementation from: http://www.movable-type.co.uk/scripts/latlong.html
func (*LngLat) MidpointTo ¶
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) PointAtDistanceAndBearing ¶
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
type LngLatCodec ¶
type LngLatCodec struct { }
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)
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)
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)
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 NewPointFrom ¶
func (*Point) CellCovering ¶
func (*Point) Descriptor
deprecated
func (*Point) GeoHashCovering ¶
func (*Point) GetAltitude ¶
func (*Point) GetCoordinate ¶
func (*Point) GetLatitude ¶
func (*Point) GetLongitude ¶
func (*Point) ProtoMessage ¶
func (*Point) ProtoMessage()
func (*Point) ProtoReflect ¶
func (x *Point) ProtoReflect() protoreflect.Message
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)
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 NewPolygonFromCell ¶
func NewPolygonFromCellID ¶
func NewPolygonFromGeoHash ¶
func (*Polygon) Add ¶
Add Appends the passed in contour to the current Polygon. Notice: point is add to first LineString of the Polygon.
func (*Polygon) CellCovering ¶
CellCovering Notice: Holes in polygon are covered too!
func (*Polygon) CellCoveringExceptHoles ¶
CellCoveringExceptHoles Notice: Holes in polygon are not covered!
func (*Polygon) Contains ¶
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) GeoHashCovering ¶
func (*Polygon) GeoHashFractionCovering ¶
func (*Polygon) GetLineStrings ¶
func (x *Polygon) GetLineStrings() []*LineString
func (*Polygon) GormDataType ¶
GormDataType gorm common data type
func (*Polygon) IsClosed ¶
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
type PolygonCodec ¶
type PolygonCodec struct { }
func (*PolygonCodec) Decode ¶
func (codec *PolygonCodec) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator)
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) Descriptor() protoreflect.EnumDescriptor
func (SpatialReference) Enum ¶
func (x SpatialReference) Enum() *SpatialReference
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 (x SpatialReference) Number() protoreflect.EnumNumber
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 ¶
func (SpatialReference) Type() protoreflect.EnumType
type SpatialReferenceCodec ¶
type SpatialReferenceCodec struct { }
func (*SpatialReferenceCodec) Decode ¶
func (codec *SpatialReferenceCodec) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator)
Source Files ¶
- bin_lng_lat.go
- bin_lng_lat.pb.go
- bounding_box.go
- bounding_box.pb.go
- bounding_box_coverage.go
- cell.go
- circle.go
- circle.pb.go
- circle.sql.go
- circle_coverage.go
- coord_transform.go
- earth.go
- feature.go
- feature.json.go
- feature.pb.go
- feature_collection.go
- feature_collection.json.go
- feature_collection.pb.go
- geo_json.go
- geo_json.json.go
- geo_json.pb.go
- geohash.go
- geom.pb.go
- geometry.go
- geometry.json.go
- geometry.sql.go
- geometry_collection.go
- geometry_collection.json.go
- geometry_coverage.go
- haversine.go
- line_string.go
- line_string.json.go
- line_string.pb.go
- line_string.sql.go
- lng_lat.fmt.go
- lng_lat.go
- lng_lat.json.go
- lng_lat.pb.go
- lng_lat.sql.go
- multi_line_string.go
- multi_line_string.json.go
- multi_line_string.pb.go
- multi_point.go
- multi_point.json.go
- multi_point.pb.go
- multi_polygon.go
- multi_polygon.json.go
- multi_polygon.pb.go
- multi_polygon_coverage.go
- point.go
- point.json.go
- point.pb.go
- point_coverage.go
- polygon.go
- polygon.json.go
- polygon.pb.go
- polygon.sql.go
- polygon_coverage.go
- spatial_reference.fmt.go
- spatial_reference.json.go
- spatial_reference.pb.go
- wkb.go
- wkt.go