Documentation
¶
Index ¶
- Constants
- func GenerateAllTilesForRadius(tileRadius float64, nbFaces int) map[Quadkey]Polygon
- func IsPointInPolygon(point Point, polygon []Point) bool
- func LatLonToTileXY(lat, lon float64, zoom int) (int, int)
- func TileXYToLatLon(x, y, zoom int) (float64, float64)
- type Coordinate
- type Edge
- type Edge3D
- type LatLong
- type Point
- type Point3D
- type Polygon
- type Quadkey
Constants ¶
const EarthRadiusKm = 6371.0 // Earth's radius in kilometers
Constants
Variables ¶
This section is empty.
Functions ¶
func GenerateAllTilesForRadius ¶
GenerateAllTilesForRadius generates all tiles and their polygons for a given radius.
func IsPointInPolygon ¶
IsPointInPolygon checks if a given point (latitude, longitude) is inside a polygon
func LatLonToTileXY ¶
LatLonToTileXY converts lat/lon to tile coordinates.
func TileXYToLatLon ¶
TileXYToLatLon converts tile coordinates to lat/lon.
Types ¶
type Coordinate ¶
type Coordinate struct {
C float64 // Coordinate value in degrees
}
Coordinate represents a geographic coordinate value
func (Coordinate) ToDegrees ¶
func (c Coordinate) ToDegrees() float64
ToDegrees converts the Coordinate object from radians to degrees
func (Coordinate) ToRadians ¶
func (c Coordinate) ToRadians() float64
ToRadians converts the Coordinate object from degrees to radians
type LatLong ¶
type LatLong struct { Lat Coordinate // Latitude in degrees Lon Coordinate // Longitude in degrees }
LatLong represents a geographic coordinate pair in WGS84 format
func (LatLong) LatDegrees ¶
LatDegrees returns the latitude in degrees
func (LatLong) LatRadians ¶
LatRadians returns the latitude in radians
func (LatLong) LonDegrees ¶
LonDegrees returns the longitude in degrees
func (LatLong) LonRadians ¶
LonRadians returns the longitude in radians
type Polygon ¶
type Polygon struct { Center Quadkey // The center Quadkey of the polygon NbFaces int // Number of faces in the polygon Radius float64 // Radius of the polygon in meters Boundaries []Point // Vertices (points) of the polygon's boundary }
Polygon represents a geographic polygon.
type Quadkey ¶
func (*Quadkey) DistanceTo ¶
DistanceTo computes the great-circle distance between two Quadkeys using the haversine formula