routeboxer

package module
v0.0.0-...-d096b66 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2017 License: MIT Imports: 2 Imported by: 0

README

Golang routeboxer

This is a Golang implementation of the RouteBoxer Class from Google.

Install

go get github.com/dernise/routeboxer

Usage

You first need to initialize a RouteBoxer object with an array of coordinates [Longitude, Latitude] representing the route and the desired range.

pointSet := geo.PointSet{
	{3.0366159982599186, 50.627300916239626}, {3.0368849735327217, 50.626974944025285}
}

routeBoxer := NewRouteBoxer(1000, pointSet)

You can now run the algorithm with :

boxes := routeBoxer.Boxes()

Once the calculation are complete, you can get a GeoJSON like object

boxes.ToGeoJson()

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RhumBearingTo

func RhumBearingTo(point geo.Point, dest geo.Point) float64

func RhumbDestinationPoint

func RhumbDestinationPoint(currentPoint geo.Point, brng float64, dist float64) *geo.Point

Types

type GeoJsonResult

type GeoJsonResult struct {
	Type        string          `json:"type"`
	Coordinates [][][]geo.Point `json:"coordinates"`
}

type RouteBoxer

type RouteBoxer struct {
	// contains filtered or unexported fields
}

func NewRouteBoxer

func NewRouteBoxer(distanceRange float64, vertices geo.PointSet) *RouteBoxer

func (*RouteBoxer) Boxes

func (r *RouteBoxer) Boxes() RouteBoxerResult

func (*RouteBoxer) FindIntersectingCells

func (r *RouteBoxer) FindIntersectingCells()

*

  • Find all of the cells in the overlaid grid that the path intersects *
  • @param {LatLng[]} vertices The vertices of the path

type RouteBoxerResult

type RouteBoxerResult []geo.Bound

func (*RouteBoxerResult) ToGeoJson

func (r *RouteBoxerResult) ToGeoJson() GeoJsonResult

Jump to

Keyboard shortcuts

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