Documentation ¶
Index ¶
- Constants
- func PseudoMercatorToWGS84(x, y float64) (lon, lat float64)
- func TileXYToLonLat(x, y float64, zoom uint32) (lon, lat float64)
- func WGS84ToPseudoMercator(lon, lat float64) (x, y float64)
- type Bound
- func (b Bound) AsPolygon() *Polygon
- func (b Bound) Bottom() float64
- func (b Bound) Bound() Bound
- func (b Bound) Cap() int
- func (b Bound) Center() Point
- func (b Bound) Clip(bound Bound) Geom
- func (b Bound) Contains(point Point) bool
- func (Bound) DataType(driverName string) string
- func (b Bound) Equal(g Geom) bool
- func (b Bound) Extend(point Point) Bound
- func (b Bound) Geometry() []uint32
- func (b Bound) Intersects(bound Bound) bool
- func (b Bound) IsEmpty() bool
- func (b Bound) Left() float64
- func (b Bound) LeftTop() Point
- func (b Bound) Pad(d float64) Bound
- func (b Bound) Project(transform Transform) Geom
- func (b Bound) Right() float64
- func (b Bound) RightBottom() Point
- func (b Bound) ToGeom() Geom
- func (b Bound) Top() float64
- func (Bound) Type() string
- func (b Bound) Union(other Bound) Bound
- type Geom
- type Geometry
- func (g Geometry) DataType(driverName string) string
- func (g Geometry) MarshalWKT(w *wkt.WKTWriter)
- func (g *Geometry) Scan(src interface{}) error
- func (g Geometry) ToGeom() Geom
- func (g *Geometry) UnmarshalWKB(r *wkb.WKBReader, order binary.ByteOrder, tpe wkb.GeometryType) error
- func (g Geometry) Value() (driver.Value, error)
- func (Geometry) ValueEx() string
- type LineString
- func (ls LineString) Bound() Bound
- func (ls LineString) Cap() int
- func (ls LineString) Clip(b Bound) Geom
- func (ls LineString) Closed() bool
- func (LineString) DataType(driverName string) string
- func (ls LineString) DrawFeature(w *mvt.FeatureWriter)
- func (ls LineString) Equal(g Geom) bool
- func (ls LineString) Geometry() []uint32
- func (ls LineString) IsValid() bool
- func (ls LineString) MarshalWKT(w *wkt.WKTWriter)
- func (ls LineString) Project(transform Transform) Geom
- func (ls *LineString) Scan(src interface{}) error
- func (ls LineString) ToGeom() Geom
- func (LineString) Type() string
- func (ls *LineString) UnmarshalWKB(r *wkb.WKBReader, order binary.ByteOrder, tpe wkb.GeometryType) error
- func (ls LineString) Value() (driver.Value, error)
- func (LineString) ValueEx() string
- type MultiLineString
- func (mls MultiLineString) Bound() Bound
- func (mls MultiLineString) Cap() int
- func (mls MultiLineString) Clip(b Bound) Geom
- func (MultiLineString) DataType(driverName string) string
- func (mls MultiLineString) DrawFeature(w *mvt.FeatureWriter)
- func (mls MultiLineString) Equal(g Geom) bool
- func (mls MultiLineString) Geometry() []uint32
- func (mls MultiLineString) MarshalWKT(w *wkt.WKTWriter)
- func (mls MultiLineString) Project(transform Transform) Geom
- func (mls *MultiLineString) Scan(src interface{}) error
- func (mls MultiLineString) ToGeom() Geom
- func (MultiLineString) Type() string
- func (mls *MultiLineString) UnmarshalWKB(r *wkb.WKBReader, order binary.ByteOrder, tpe wkb.GeometryType) error
- func (mls MultiLineString) Value() (driver.Value, error)
- func (MultiLineString) ValueEx() string
- type MultiPoint
- func (mp MultiPoint) Bound() Bound
- func (mp MultiPoint) Cap() int
- func (mp MultiPoint) Clip(b Bound) Geom
- func (MultiPoint) DataType(driverName string) string
- func (mp MultiPoint) DrawFeature(w *mvt.FeatureWriter)
- func (mp MultiPoint) Equal(g Geom) bool
- func (mp MultiPoint) Geometry() []uint32
- func (mp MultiPoint) MarshalWKT(w *wkt.WKTWriter)
- func (mp MultiPoint) Project(transform Transform) Geom
- func (mp *MultiPoint) Scan(src interface{}) error
- func (mp MultiPoint) ToGeom() Geom
- func (MultiPoint) Type() string
- func (mp *MultiPoint) UnmarshalWKB(r *wkb.WKBReader, order binary.ByteOrder, tpe wkb.GeometryType) error
- func (mp MultiPoint) Value() (driver.Value, error)
- func (MultiPoint) ValueEx() string
- type MultiPolygon
- func (mp MultiPolygon) Bound() Bound
- func (mp MultiPolygon) Cap() int
- func (mp MultiPolygon) Clip(b Bound) Geom
- func (MultiPolygon) DataType(driverName string) string
- func (mp MultiPolygon) DrawFeature(w *mvt.FeatureWriter)
- func (mp MultiPolygon) Equal(g Geom) bool
- func (mp MultiPolygon) Geometry() []uint32
- func (mp MultiPolygon) MarshalWKT(w *wkt.WKTWriter)
- func (mp MultiPolygon) Project(transform Transform) Geom
- func (mp *MultiPolygon) Scan(src interface{}) error
- func (mp MultiPolygon) ToGeom() Geom
- func (MultiPolygon) Type() string
- func (mp *MultiPolygon) UnmarshalWKB(r *wkb.WKBReader, order binary.ByteOrder, tpe wkb.GeometryType) error
- func (mp MultiPolygon) Value() (driver.Value, error)
- func (MultiPolygon) ValueEx() string
- type Point
- func (p Point) Bound() Bound
- func (Point) Cap() int
- func (p Point) Clip(bound Bound) Geom
- func (Point) DataType(driverName string) string
- func (p Point) DrawFeature(w *mvt.FeatureWriter)
- func (p Point) Equal(geom Geom) bool
- func (p Point) Geometry() []uint32
- func (p Point) IsZero() bool
- func (p Point) Lat() float64
- func (p Point) Lon() float64
- func (p Point) MarshalWKT(w *wkt.WKTWriter)
- func (p Point) Project(transform Transform) Geom
- func (p *Point) Scan(src interface{}) error
- func (p Point) ToGeom() Geom
- func (Point) Type() string
- func (p *Point) UnmarshalWKB(r *wkb.WKBReader, order binary.ByteOrder, tpe wkb.GeometryType) error
- func (p Point) Value() (driver.Value, error)
- func (Point) ValueEx() string
- func (p Point) X() float64
- func (p Point) Y() float64
- type Polygon
- func (p Polygon) Bound() Bound
- func (p Polygon) Cap() int
- func (p Polygon) Clip(b Bound) Geom
- func (Polygon) DataType(driverName string) string
- func (p Polygon) DrawFeature(w *mvt.FeatureWriter)
- func (p Polygon) Equal(g Geom) bool
- func (p Polygon) Geometry() []uint32
- func (p Polygon) MarshalWKT(w *wkt.WKTWriter)
- func (p Polygon) Project(transform Transform) Geom
- func (p *Polygon) Scan(src interface{}) error
- func (p Polygon) ToGeom() Geom
- func (Polygon) Type() string
- func (p *Polygon) UnmarshalWKB(r *wkb.WKBReader, order binary.ByteOrder, tpe wkb.GeometryType) error
- func (p Polygon) Value() (driver.Value, error)
- func (Polygon) ValueEx() string
- type Transform
Constants ¶
View Source
const ( // https://epsg.io/3857 SRS3857 = 3857 // https://epsg.io/4326 SRS4326 = 4326 )
View Source
const ( EPSLN = 1.0e-10 D2R = math.Pi / 180.0 R2D = 180.0 / math.Pi A = 6378137.0 MAXEXTENT = 20037508.342789244 )
Variables ¶
This section is empty.
Functions ¶
func PseudoMercatorToWGS84 ¶
func TileXYToLonLat ¶
func WGS84ToPseudoMercator ¶
Types ¶
type Geometry ¶
type Geometry struct {
Geom
}
func ToGeometry ¶
func (Geometry) MarshalWKT ¶
func (*Geometry) UnmarshalWKB ¶
type LineString ¶
type LineString []Point
func (LineString) Bound ¶
func (ls LineString) Bound() Bound
func (LineString) Cap ¶
func (ls LineString) Cap() int
func (LineString) Clip ¶
func (ls LineString) Clip(b Bound) Geom
func (LineString) Closed ¶
func (ls LineString) Closed() bool
func (LineString) DataType ¶
func (LineString) DataType(driverName string) string
func (LineString) DrawFeature ¶
func (ls LineString) DrawFeature(w *mvt.FeatureWriter)
func (LineString) Equal ¶
func (ls LineString) Equal(g Geom) bool
func (LineString) Geometry ¶
func (ls LineString) Geometry() []uint32
func (LineString) IsValid ¶
func (ls LineString) IsValid() bool
func (LineString) MarshalWKT ¶
func (ls LineString) MarshalWKT(w *wkt.WKTWriter)
func (LineString) Project ¶
func (ls LineString) Project(transform Transform) Geom
func (*LineString) Scan ¶
func (ls *LineString) Scan(src interface{}) error
func (LineString) ToGeom ¶
func (ls LineString) ToGeom() Geom
func (LineString) Type ¶
func (LineString) Type() string
func (*LineString) UnmarshalWKB ¶
func (ls *LineString) UnmarshalWKB(r *wkb.WKBReader, order binary.ByteOrder, tpe wkb.GeometryType) error
func (LineString) ValueEx ¶
func (LineString) ValueEx() string
type MultiLineString ¶
type MultiLineString []LineString
func (MultiLineString) Bound ¶
func (mls MultiLineString) Bound() Bound
func (MultiLineString) Cap ¶
func (mls MultiLineString) Cap() int
func (MultiLineString) Clip ¶
func (mls MultiLineString) Clip(b Bound) Geom
func (MultiLineString) DataType ¶
func (MultiLineString) DataType(driverName string) string
func (MultiLineString) DrawFeature ¶
func (mls MultiLineString) DrawFeature(w *mvt.FeatureWriter)
func (MultiLineString) Equal ¶
func (mls MultiLineString) Equal(g Geom) bool
func (MultiLineString) Geometry ¶
func (mls MultiLineString) Geometry() []uint32
func (MultiLineString) MarshalWKT ¶
func (mls MultiLineString) MarshalWKT(w *wkt.WKTWriter)
func (MultiLineString) Project ¶
func (mls MultiLineString) Project(transform Transform) Geom
func (*MultiLineString) Scan ¶
func (mls *MultiLineString) Scan(src interface{}) error
func (MultiLineString) ToGeom ¶
func (mls MultiLineString) ToGeom() Geom
func (MultiLineString) Type ¶
func (MultiLineString) Type() string
func (*MultiLineString) UnmarshalWKB ¶
func (mls *MultiLineString) UnmarshalWKB(r *wkb.WKBReader, order binary.ByteOrder, tpe wkb.GeometryType) error
func (MultiLineString) ValueEx ¶
func (MultiLineString) ValueEx() string
type MultiPoint ¶
type MultiPoint []Point
func (MultiPoint) Bound ¶
func (mp MultiPoint) Bound() Bound
func (MultiPoint) Cap ¶
func (mp MultiPoint) Cap() int
func (MultiPoint) Clip ¶
func (mp MultiPoint) Clip(b Bound) Geom
func (MultiPoint) DataType ¶
func (MultiPoint) DataType(driverName string) string
func (MultiPoint) DrawFeature ¶
func (mp MultiPoint) DrawFeature(w *mvt.FeatureWriter)
func (MultiPoint) Equal ¶
func (mp MultiPoint) Equal(g Geom) bool
func (MultiPoint) Geometry ¶
func (mp MultiPoint) Geometry() []uint32
func (MultiPoint) MarshalWKT ¶
func (mp MultiPoint) MarshalWKT(w *wkt.WKTWriter)
func (MultiPoint) Project ¶
func (mp MultiPoint) Project(transform Transform) Geom
func (*MultiPoint) Scan ¶
func (mp *MultiPoint) Scan(src interface{}) error
func (MultiPoint) ToGeom ¶
func (mp MultiPoint) ToGeom() Geom
func (MultiPoint) Type ¶
func (MultiPoint) Type() string
func (*MultiPoint) UnmarshalWKB ¶
func (mp *MultiPoint) UnmarshalWKB(r *wkb.WKBReader, order binary.ByteOrder, tpe wkb.GeometryType) error
func (MultiPoint) ValueEx ¶
func (MultiPoint) ValueEx() string
type MultiPolygon ¶
type MultiPolygon []Polygon
func (MultiPolygon) Bound ¶
func (mp MultiPolygon) Bound() Bound
func (MultiPolygon) Cap ¶
func (mp MultiPolygon) Cap() int
func (MultiPolygon) Clip ¶
func (mp MultiPolygon) Clip(b Bound) Geom
func (MultiPolygon) DataType ¶
func (MultiPolygon) DataType(driverName string) string
func (MultiPolygon) DrawFeature ¶
func (mp MultiPolygon) DrawFeature(w *mvt.FeatureWriter)
func (MultiPolygon) Equal ¶
func (mp MultiPolygon) Equal(g Geom) bool
func (MultiPolygon) Geometry ¶
func (mp MultiPolygon) Geometry() []uint32
func (MultiPolygon) MarshalWKT ¶
func (mp MultiPolygon) MarshalWKT(w *wkt.WKTWriter)
func (MultiPolygon) Project ¶
func (mp MultiPolygon) Project(transform Transform) Geom
func (*MultiPolygon) Scan ¶
func (mp *MultiPolygon) Scan(src interface{}) error
func (MultiPolygon) ToGeom ¶
func (mp MultiPolygon) ToGeom() Geom
func (MultiPolygon) Type ¶
func (MultiPolygon) Type() string
func (*MultiPolygon) UnmarshalWKB ¶
func (mp *MultiPolygon) UnmarshalWKB(r *wkb.WKBReader, order binary.ByteOrder, tpe wkb.GeometryType) error
func (MultiPolygon) ValueEx ¶
func (MultiPolygon) ValueEx() string
type Point ¶
type Point [2]float64
func (Point) DrawFeature ¶
func (p Point) DrawFeature(w *mvt.FeatureWriter)
func (Point) MarshalWKT ¶
func (*Point) UnmarshalWKB ¶
type Polygon ¶
type Polygon []LineString
Polygon is a closed area. The first Polygon is the outer ring. The others are the holes. Each Polygon is expected to be closed ie. the first point matches the last.
func (Polygon) DrawFeature ¶
func (p Polygon) DrawFeature(w *mvt.FeatureWriter)
func (Polygon) MarshalWKT ¶
func (*Polygon) UnmarshalWKB ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.